Fixed workshop times and schedule

This commit is contained in:
Godwin
2017-02-27 17:26:27 -08:00
parent 89af3c5aae
commit 572e0d6644
5 changed files with 126 additions and 101 deletions
@@ -1149,13 +1149,25 @@ class ConferenceAdministrationController < ApplicationController
def admin_update_workshop_times
case params[:button]
when 'save_block'
empty_param = empty_params(:time, :time_span, :days)
if empty_param.present?
set_error_message "save_block_#{empty_param}_required".to_sym
else
@this_conference.workshop_blocks ||= []
@this_conference.workshop_blocks[params[:workshop_block].to_i] = {
'time' => params[:time],
'length' => params[:time_span],
'days' => params[:days].keys
}
@this_conference.save
set_success_message :block_saved
end
return false
when 'delete_block'
@this_conference.workshop_blocks ||= []
@this_conference.workshop_blocks[params[:workshop_block].to_i] = {
'time' => params[:time],
'length' => params[:time_span],
'days' => params[:days].keys
}
@this_conference.workshop_blocks.delete_at(params[:workshop_block].to_i)
@this_conference.save
set_success_message :block_deleted
return false
end
@@ -1163,6 +1175,19 @@ class ConferenceAdministrationController < ApplicationController
return nil
end
def admin_update_publish_schedule
case params[:button]
when 'publish'
@this_conference.workshop_schedule_published = !@this_conference.workshop_schedule_published
@this_conference.save
set_success_message "schedule_#{@this_conference.workshop_schedule_published ? '' : 'un'}published".to_sym
return false
end
do_404
return false
end
def admin_update_schedule
case params[:button]
when 'deschedule_workshop'
@@ -1207,18 +1232,6 @@ class ConferenceAdministrationController < ApplicationController
return nil
end
def admin_update_schedule
case params[:button]
when 'publish'
@this_conference.workshop_schedule_published = !@this_conference.workshop_schedule_published
@this_conference.save
return false
end
do_404
return false
end
def admin_update_providers
case params[:button]
when 'save_distance'
@@ -1243,4 +1256,8 @@ class ConferenceAdministrationController < ApplicationController
end
return nil
end
def empty_params(*args)
get_empty(params, args)
end
end