mirror of
https://github.com/openSUSE/osem.git
synced 2026-05-15 19:37:13 -04:00
edit event from admin panel, show actual submitter and update event details
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user