Skip to content
Browse files

Fixed error in the logo path in spaces/new.

  • Loading branch information...
1 parent e84d27c commit 276ce0dbacec2d2f0305a1a5782be4b468fd658a @daronco daronco committed
View
5 app/assets/javascripts/old/spaces/new.js.erb
@@ -3,8 +3,11 @@ $(function() {
if (isOnPage('spaces', 'new|create')) {
setNewLogo = function(img) {
- $("#space_image").attr('value', img);
$("#selected-logo-image").attr('src', img);
+
+ // the hidden field that defines the image selected
+ img = img.replace("/assets", "");
+ $("#space_image").attr('value', img);
}
// when clicking in a logo in the gallery
View
43 app/controllers/spaces_controller.rb
@@ -88,29 +88,8 @@ def edit
end
def create
- unless logged_in?
- if params[:register]
- cookies.delete :auth_token
- @user = User.new(params[:user])
- unless @user.save_with_captcha
- message = ""
- @user.errors.full_messages.each {|msg| message += msg + " <br/>"}
- flash[:error] = message
- render :action => :new, :layout => "frontpage"
- return
- end
- end
-
- self.current_agent = User.authenticate_with_login_and_password(params[:user][:email], params[:user][:password])
- unless logged_in?
- flash[:error] = t('error.credentials')
- render :action => :new, :layout => "frontpage"
- return
- end
- end
-
+ # TODO: this shouldn't be here
params[:space][:repository] = 1;
-
params[:space][:bigbluebutton_room_attributes] ||= {}
params[:space][:bigbluebutton_room_attributes][:name] = params[:space][:name]
params[:space][:bigbluebutton_room_attributes][:private] = !ActiveRecord::ConnectionAdapters::Column.value_to_boolean(params[:space][:public])
@@ -119,20 +98,18 @@ def create
@space = Space.new(params[:space])
- respond_to do |format|
-
- if @space.save
+ if @space.save
+ respond_with @space do |format|
flash[:success] = t('space.created')
@space.stage_performances.create(:agent => current_user, :role => Space.role('Admin'))
-
format.html { redirect_to :action => "show", :id => @space }
- else
- format.html {
- message = ""
- @space.errors.full_messages.each {|msg| message += msg + " <br/>"}
- flash[:error] = message
- render :action => :new, :layout => "application"
- }
+ end
+ else
+ respond_with @space do |format|
+ # TODO: error is shown with a notification and not with simple_form, why?
+ #message = @space.errors.full_messages.join("<br/>")
+ #flash[:error] = message
+ format.html { render :action => :new, :layout => "no_sidebar" }
end
end
end
View
2 app/views/spaces/new.html.haml
@@ -25,7 +25,7 @@
= f.fields_for :bigbluebutton_room do |r|
= r.input :attendee_password, :as => :showable_password, :label => t('activerecord.attributes.spaces.attendee_password')
= r.input :moderator_password, :as => :showable_password, :label => t('activerecord.attributes.spaces.moderator_password')
- = hidden_field "space", "image", :value => "/assets/default_space_logos/" + @files[selected].to_s, :name => "space[default_logo]"
+ = hidden_field "space", "image", :value => "/default_space_logos/" + @files[selected].to_s, :name => "space[default_logo]"
= f.button :submit, t("button.create"), :class => "btn"
.right-column
View
2 config/locales/en/mconf.yml
@@ -653,7 +653,7 @@ en:
part2: "1. Click on <a href=%{url}> My Home </a> item from the top bar."
part3: "2. Click on <a href=%{url}>Create New Space </a> button."
part4: "3. Type a name and description for your space."
- part5: "4. Decide whether the space should be public. Collaborative spaces can be public, for anybody to watch what happens in them, or private, where members only have access to the activities of the space."
+ part5: "4. Decide whether the space should be public. Collaborative spaces can be public, for anybody to watch what happens in them, or private, where only members have access to the activities of the space."
part6: "5. If you want to enable a document repository, choose this option. <br>6. You can associate a mailing list to your group. It will allow you to send email messages to your group instead of having to pick out the individual addresses every time.<br>7. You can upload your own logo, create a text logo or select an image from the gallery."
help_createuser:
part1: "To create a user in Global Plaza:"

0 comments on commit 276ce0d

Please sign in to comment.
Something went wrong with that request. Please try again.