implement manual event management and support for multiple speakers per event

This commit is contained in:
Eugene Dubinin 2017-02-02 16:34:59 +02:00
parent 46a6a59622
commit 790e2fd3a2
24 changed files with 180 additions and 89 deletions

View file

@ -5,7 +5,7 @@ module Admin
load_and_authorize_resource :event, through: :program
load_and_authorize_resource :events_registration, only: :toggle_attendance
before_action :get_event, except: [:index, :create]
before_action :get_event, except: [:index, :create, :new]
# FIXME: The timezome should only be applied on output, otherwise
# you get lost in timezone conversions...
@ -62,6 +62,7 @@ module Admin
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@user = @event.submitter
@users = User.all.order(:name)
@url = admin_conference_program_event_path(@conference.short_title, @event)
@languages = @program.languages_list
end
@ -79,6 +80,8 @@ module Admin
end
def update
@users = User.all.order(:name)
@languages = @program.languages_list
if @event.update_attributes(event_params)
if request.xhr?
@ -94,7 +97,26 @@ module Admin
end
end
def create; end
def create
@url = admin_conference_program_events_path(@conference.short_title, @event)
@users = User.all.order(:name)
@languages = @program.languages_list
@event.submitter = current_user
if @event.save
ahoy.track 'Event submission', title: 'New submission'
redirect_to admin_conference_program_events_path(@conference.short_title), notice: 'Event was successfully submitted.'
else
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
render action: 'new'
end
end
def new
@url = admin_conference_program_events_path(@conference.short_title, @event)
@languages = @program.languages_list
@users = User.all.order(:name)
end
def accept
send_mail = @event.program.conference.email_settings.send_on_accepted
@ -161,7 +183,8 @@ module Admin
# Set only in admin/events controller
:track_id, :state, :language, :is_highlight, :max_attendees,
# Not used anymore?
:proposal_additional_speakers, :user, :users_attributes)
:proposal_additional_speakers, :user, :users_attributes,
speaker_ids: [])
end
def comment_params