Skip to content

Commit

Permalink
Fixed error in the logo path in spaces/new.
Browse files Browse the repository at this point in the history
  • Loading branch information
daronco committed May 12, 2012
1 parent e84d27c commit 276ce0d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 36 deletions.
5 changes: 4 additions & 1 deletion app/assets/javascripts/old/spaces/new.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 10 additions & 33 deletions app/controllers/spaces_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/spaces/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en/mconf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit 276ce0d

Please sign in to comment.