Merge pull request #1319 from JewelSam/master

#1220 adding the cell size attribute to the database
This commit is contained in:
Ana María Martínez Gómez 2017-04-03 10:23:49 +02:00 committed by GitHub
commit f3e712a1bc
19 changed files with 104 additions and 35 deletions

View file

@ -12,13 +12,15 @@ module Admin
@program = @conference.program
@program.assign_attributes(program_params)
send_mail_on_schedule_public = @program.notify_on_schedule_public?
event_schedules_count_was = @program.event_schedules.count
if @program.update_attributes(program_params)
ConferenceScheduleUpdateMailJob.perform_later(@conference) if send_mail_on_schedule_public
respond_to do |format|
format.html do
redirect_to admin_conference_program_path(@conference.short_title),
notice: 'The program was successfully updated.'
notice = 'The program was successfully updated.'
notice += ' You changed schedule interval and some events were unscheduled.' if @program.event_schedules.count != event_schedules_count_was
redirect_to admin_conference_program_path(@conference.short_title), notice: notice
end
format.js { render json: {} }
end
@ -36,7 +38,7 @@ module Admin
private
def program_params
params.require(:program).permit(:rating, :schedule_public, :schedule_fluid, :languages, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id)
params.require(:program).permit(:rating, :schedule_public, :schedule_interval, :schedule_fluid, :languages, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id)
end
end
end

View file

@ -14,7 +14,7 @@ class SchedulesController < ApplicationController
@events_xml = schedules.map(&:event).group_by{ |event| event.time.to_date } if schedules
@dates = @conference.start_date..@conference.end_date
@step_minutes = EventType::LENGTH_STEP.minutes
@step_minutes = @program.schedule_interval.minutes
@conf_start = @conference.start_hour
@conf_period = @conference.end_hour - @conf_start