edit event from admin panel, show actual submitter and update event details
This commit is contained in:
parent
f905bb8f8f
commit
071cd81029
2 changed files with 7 additions and 4 deletions
|
|
@ -33,10 +33,8 @@ class Admin::EventsController < ApplicationController
|
||||||
@tracks = Track.all
|
@tracks = Track.all
|
||||||
@comments = @event.root_comments
|
@comments = @event.root_comments
|
||||||
@comment_count = @event.comment_threads.count
|
@comment_count = @event.comment_threads.count
|
||||||
|
|
||||||
@event = Event.find_by_id(params[:id])
|
|
||||||
@person = @event.submitter
|
@person = @event.submitter
|
||||||
@url = edit_admin_conference_event_path(@conference.short_title, @event)
|
@url = admin_conference_event_path(@conference.short_title, @event)
|
||||||
end
|
end
|
||||||
|
|
||||||
def comment
|
def comment
|
||||||
|
|
@ -58,6 +56,11 @@ class Admin::EventsController < ApplicationController
|
||||||
if params.has_key? :event_type_id
|
if params.has_key? :event_type_id
|
||||||
@event.update_attribute(:event_type_id, params[:event_type_id])
|
@event.update_attribute(:event_type_id, params[:event_type_id])
|
||||||
end
|
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
|
expire_page :controller => '/schedule', :action => :index
|
||||||
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event), :notice => "Updated")
|
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event), :notice => "Updated")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
= @event.subtitle
|
= @event.subtitle
|
||||||
|
|
||||||
.span2
|
.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
|
.row-fluid
|
||||||
.span12
|
.span12
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue