edit event from admin panel, show actual submitter and update event details

This commit is contained in:
differentreality
2013-07-28 21:21:54 +03:00
parent f905bb8f8f
commit 071cd81029
2 changed files with 7 additions and 4 deletions

View File

@@ -33,10 +33,8 @@ class Admin::EventsController < ApplicationController
@tracks = Track.all
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@event = Event.find_by_id(params[:id])
@person = @event.submitter
@url = edit_admin_conference_event_path(@conference.short_title, @event)
@url = admin_conference_event_path(@conference.short_title, @event)
end
def comment
@@ -58,6 +56,11 @@ class Admin::EventsController < ApplicationController
if params.has_key? :event_type_id
@event.update_attribute(:event_type_id, params[:event_type_id])
end
if @event.update_attributes(params[:event]) && @event.submitter.update_attributes(params[:person])
flash[:notice] = "Successfully updated #{@event.title}."
else
flash[:notice] = "Update not successful."
end
expire_page :controller => '/schedule', :action => :index
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event), :notice => "Updated")
end

View File

@@ -7,7 +7,7 @@
= @event.subtitle
.span2
= link_to "Edit", edit_conference_proposal_path(@conference.short_title, @event.id), :class => "btn btn-mini btn-primary"
= link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary"
.row-fluid
.span12