enable style ClassAndModuleChildren
This commit is contained in:
parent
2f814c7320
commit
1c1391c69e
15 changed files with 475 additions and 448 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
# Offense count: 20
|
# Offense count: 20
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||||
Style/ClassAndModuleChildren:
|
Style/ClassAndModuleChildren:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
# Offense count: 3
|
# Offense count: 3
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,54 @@
|
||||||
class Admin::CallforpapersController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class CallforpapersController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@cfp = @conference.call_for_papers
|
@cfp = @conference.call_for_papers
|
||||||
if @cfp.nil?
|
if @cfp.nil?
|
||||||
@cfp = CallForPapers.new
|
@cfp = CallForPapers.new
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@cfp = @conference.call_for_papers
|
@cfp = @conference.call_for_papers
|
||||||
@cfp.assign_attributes(params[:call_for_papers])
|
@cfp.assign_attributes(params[:call_for_papers])
|
||||||
notify_on_schedule_public = @cfp.schedule_public_changed? && @cfp.schedule_public\
|
notify_on_schedule_public = @cfp.schedule_public_changed? && @cfp.schedule_public\
|
||||||
&& @conference.email_settings.send_on_call_for_papers_schedule_public\
|
&& @conference.email_settings.send_on_call_for_papers_schedule_public\
|
||||||
&& !@conference.email_settings.call_for_papers_schedule_public_subject.blank?\
|
&& !@conference.email_settings.call_for_papers_schedule_public_subject.blank?\
|
||||||
&& !@conference.email_settings.call_for_papers_schedule_public_template.blank?
|
&& !@conference.email_settings.call_for_papers_schedule_public_template.blank?
|
||||||
|
|
||||||
notify_on_cfp_date_update = !@cfp.end_date.blank? && !@cfp.start_date.blank?\
|
notify_on_cfp_date_update = !@cfp.end_date.blank? && !@cfp.start_date.blank?\
|
||||||
&& (@cfp.start_date_changed? || @cfp.end_date_changed?)\
|
&& (@cfp.start_date_changed? || @cfp.end_date_changed?)\
|
||||||
&& @conference.email_settings.send_on_call_for_papers_dates_updates\
|
&& @conference.email_settings.send_on_call_for_papers_dates_updates\
|
||||||
&& !@conference.email_settings.call_for_papers_dates_updates_subject.blank?\
|
&& !@conference.email_settings.call_for_papers_dates_updates_subject.blank?\
|
||||||
&& !@conference.email_settings.call_for_papers_dates_updates_template.blank?
|
&& !@conference.email_settings.call_for_papers_dates_updates_template.blank?
|
||||||
|
|
||||||
if @cfp.update_attributes(params[:call_for_papers])
|
if @cfp.update_attributes(params[:call_for_papers])
|
||||||
Mailbot.delay.send_on_call_for_papers_dates_updates(@conference) if notify_on_cfp_date_update
|
Mailbot.delay.send_on_call_for_papers_dates_updates(@conference) if notify_on_cfp_date_update
|
||||||
Mailbot.delay.send_on_schedule_public(@conference) if notify_on_schedule_public
|
Mailbot.delay.send_on_schedule_public(@conference) if notify_on_schedule_public
|
||||||
redirect_to(admin_conference_callforpapers_path(
|
redirect_to(admin_conference_callforpapers_path(
|
||||||
id: @conference.short_title),
|
id: @conference.short_title),
|
||||||
notice: 'Call for Papers was successfully updated.')
|
notice: 'Call for Papers was successfully updated.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_callforpapers_path(
|
redirect_to(admin_conference_callforpapers_path(
|
||||||
id: @conference.short_title),
|
id: @conference.short_title),
|
||||||
alert: "Updating call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
alert: "Updating call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@cfp = CallForPapers.new(params[:call_for_papers])
|
@cfp = CallForPapers.new(params[:call_for_papers])
|
||||||
if @cfp.valid?
|
if @cfp.valid?
|
||||||
@cfp.save
|
@cfp.save
|
||||||
@conference.call_for_papers = @cfp
|
@conference.call_for_papers = @cfp
|
||||||
redirect_to(admin_conference_callforpapers_path(
|
redirect_to(admin_conference_callforpapers_path(
|
||||||
id: @conference.short_title),
|
id: @conference.short_title),
|
||||||
notice: 'Call for Papers was successfully created.')
|
notice: 'Call for Papers was successfully created.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_callforpapers_path(
|
redirect_to(admin_conference_callforpapers_path(
|
||||||
id: @conference.short_title),
|
id: @conference.short_title),
|
||||||
alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,175 +1,177 @@
|
||||||
class Admin::ConferenceController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class ConferenceController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# Redirect to new form if there is no conference
|
# Redirect to new form if there is no conference
|
||||||
if Conference.count == 0
|
if Conference.count == 0
|
||||||
redirect_to new_admin_conference_path
|
redirect_to new_admin_conference_path
|
||||||
return
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
@total_user = User.count
|
||||||
|
@new_user = User.where('created_at > ?', current_user.last_sign_in_at).count
|
||||||
|
|
||||||
|
@total_reg = Registration.count
|
||||||
|
@new_reg = Registration.where('created_at > ?', current_user.last_sign_in_at).count
|
||||||
|
|
||||||
|
@total_submissions = Event.count
|
||||||
|
@new_submissions = Event.where('created_at > ?', current_user.last_sign_in_at).count
|
||||||
|
|
||||||
|
@active_conferences = Conference.get_active_conferences_for_dashboard # pending or the last two
|
||||||
|
@deactive_conferences = Conference.
|
||||||
|
get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active
|
||||||
|
@conferences = @active_conferences + @deactive_conferences
|
||||||
|
|
||||||
|
@recent_users = User.limit(5).order(created_at: :desc)
|
||||||
|
@recent_events = Event.limit(5).order(created_at: :desc)
|
||||||
|
@recent_registrations = Registration.limit(5).order(created_at: :desc)
|
||||||
|
|
||||||
|
@top_submitter = Conference.get_top_submitter
|
||||||
|
|
||||||
|
@submissions = {}
|
||||||
|
@cfp_weeks = [0]
|
||||||
|
|
||||||
|
@registrations = {}
|
||||||
|
@registration_weeks = [0]
|
||||||
|
|
||||||
|
@conferences.each do |c|
|
||||||
|
# Event submissions over time chart
|
||||||
|
@submissions[c.short_title] = c.get_submissions_per_week
|
||||||
|
@cfp_weeks.push(@submissions[c.short_title].length)
|
||||||
|
|
||||||
|
# Conference registrations over time chart
|
||||||
|
@registrations[c.short_title] = c.get_registrations_per_week
|
||||||
|
@registration_weeks.push(@registrations[c.short_title].length)
|
||||||
|
end
|
||||||
|
|
||||||
|
@cfp_weeks = @cfp_weeks.max
|
||||||
|
@submissions = normalize_array_length(@submissions, @cfp_weeks)
|
||||||
|
@cfp_weeks = @cfp_weeks > 0 ? (1..@cfp_weeks).to_a : 1
|
||||||
|
|
||||||
|
@registration_weeks = @registration_weeks.max
|
||||||
|
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
||||||
|
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
||||||
|
|
||||||
|
@event_distribution = Conference.event_distribution
|
||||||
|
@user_distribution = Conference.user_distribution
|
||||||
end
|
end
|
||||||
|
|
||||||
@total_user = User.count
|
def new
|
||||||
@new_user = User.where('created_at > ?', current_user.last_sign_in_at).count
|
@conference = Conference.new
|
||||||
|
|
||||||
@total_reg = Registration.count
|
|
||||||
@new_reg = Registration.where('created_at > ?', current_user.last_sign_in_at).count
|
|
||||||
|
|
||||||
@total_submissions = Event.count
|
|
||||||
@new_submissions = Event.where('created_at > ?', current_user.last_sign_in_at).count
|
|
||||||
|
|
||||||
@active_conferences = Conference.get_active_conferences_for_dashboard # pending or the last two
|
|
||||||
@deactive_conferences = Conference.
|
|
||||||
get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active
|
|
||||||
@conferences = @active_conferences + @deactive_conferences
|
|
||||||
|
|
||||||
@recent_users = User.limit(5).order(created_at: :desc)
|
|
||||||
@recent_events = Event.limit(5).order(created_at: :desc)
|
|
||||||
@recent_registrations = Registration.limit(5).order(created_at: :desc)
|
|
||||||
|
|
||||||
@top_submitter = Conference.get_top_submitter
|
|
||||||
|
|
||||||
@submissions = {}
|
|
||||||
@cfp_weeks = [0]
|
|
||||||
|
|
||||||
@registrations = {}
|
|
||||||
@registration_weeks = [0]
|
|
||||||
|
|
||||||
@conferences.each do |c|
|
|
||||||
# Event submissions over time chart
|
|
||||||
@submissions[c.short_title] = c.get_submissions_per_week
|
|
||||||
@cfp_weeks.push(@submissions[c.short_title].length)
|
|
||||||
|
|
||||||
# Conference registrations over time chart
|
|
||||||
@registrations[c.short_title] = c.get_registrations_per_week
|
|
||||||
@registration_weeks.push(@registrations[c.short_title].length)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@cfp_weeks = @cfp_weeks.max
|
def create
|
||||||
@submissions = normalize_array_length(@submissions, @cfp_weeks)
|
@conference = Conference.new(params[:conference])
|
||||||
@cfp_weeks = @cfp_weeks > 0 ? (1..@cfp_weeks).to_a : 1
|
if @conference.valid?
|
||||||
|
@conference.save
|
||||||
@registration_weeks = @registration_weeks.max
|
redirect_to(admin_conference_path(id: @conference.short_title),
|
||||||
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
notice: 'Conference was successfully created.')
|
||||||
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
else
|
||||||
|
render action: 'new'
|
||||||
@event_distribution = Conference.event_distribution
|
end
|
||||||
@user_distribution = Conference.user_distribution
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
@conference = Conference.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
@conference = Conference.new(params[:conference])
|
|
||||||
if @conference.valid?
|
|
||||||
@conference.save
|
|
||||||
redirect_to(admin_conference_path(id: @conference.short_title),
|
|
||||||
notice: 'Conference was successfully created.')
|
|
||||||
else
|
|
||||||
render action: 'new'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
@conference = Conference.find_by(short_title: params[:id])
|
|
||||||
short_title = @conference.short_title
|
|
||||||
@conference.assign_attributes(params[:conference])
|
|
||||||
notify_on_conf_dates_updates = (@conference.start_date_changed? || @conference.end_date_changed?)\
|
|
||||||
&& @conference.email_settings.send_on_updated_conference_dates\
|
|
||||||
&& !@conference.email_settings.updated_conference_dates_subject.blank?\
|
|
||||||
&& @conference.email_settings.updated_conference_dates_template
|
|
||||||
|
|
||||||
notify_on_conf_reg_dates_updates = (@conference.registration_start_date_changed? || @conference.registration_end_date_changed?)\
|
|
||||||
&& @conference.email_settings.send_on_updated_conference_registration_dates\
|
|
||||||
&& !@conference.email_settings.updated_conference_registration_dates_subject.blank?\
|
|
||||||
&& @conference.email_settings.updated_conference_registration_dates_template
|
|
||||||
|
|
||||||
if @conference.update_attributes(params[:conference])
|
|
||||||
Mailbot.delay.conference_date_update_mail(@conference) if notify_on_conf_dates_updates
|
|
||||||
Mailbot.delay.conference_registration_date_update_mail(@conference) if notify_on_conf_reg_dates_updates
|
|
||||||
redirect_to(edit_admin_conference_path(id: @conference.short_title),
|
|
||||||
notice: 'Conference was successfully updated.')
|
|
||||||
else
|
|
||||||
redirect_to(edit_admin_conference_path(id: short_title),
|
|
||||||
alert: 'Updating conference failed. ' \
|
|
||||||
"#{@conference.errors.full_messages.join('. ')}.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@conference = Conference.find_by(short_title: params[:id])
|
|
||||||
|
|
||||||
# Overview and since last login information
|
|
||||||
@total_reg = @conference.registrations.count
|
|
||||||
@new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count
|
|
||||||
|
|
||||||
@total_submissions = @conference.events.count
|
|
||||||
@new_submissions = @conference.events.
|
|
||||||
where('created_at > ?', current_user.last_sign_in_at).count
|
|
||||||
|
|
||||||
@program_length = @conference.current_program_hours
|
|
||||||
@new_program_length = @conference.new_program_hours(current_user.last_sign_in_at)
|
|
||||||
|
|
||||||
# Step by step list
|
|
||||||
@conference_progress = @conference.get_status
|
|
||||||
|
|
||||||
# Line charts
|
|
||||||
@registrations = { @conference.short_title => @conference.get_registrations_per_week }
|
|
||||||
@registration_weeks = [0]
|
|
||||||
@registration_weeks.push(@registrations[@conference.short_title].length)
|
|
||||||
|
|
||||||
@registration_weeks = @registration_weeks.max
|
|
||||||
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
|
||||||
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
|
||||||
|
|
||||||
@submissions = Conference.get_event_state_line_colors
|
|
||||||
|
|
||||||
@submissions_data = {}
|
|
||||||
@submissions_data = @conference.get_submissions_data
|
|
||||||
@cfp_weeks = 0
|
|
||||||
if @submissions_data['Weeks']
|
|
||||||
@cfp_weeks = @submissions_data['Weeks']
|
|
||||||
@submissions_data = @submissions_data.except('Weeks')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Doughnut charts
|
def update
|
||||||
@event_type_distribution = @conference.event_type_distribution
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
@event_type_distribution_confirmed = @conference.event_type_distribution(:confirmed)
|
short_title = @conference.short_title
|
||||||
|
@conference.assign_attributes(params[:conference])
|
||||||
|
notify_on_conf_dates_updates = (@conference.start_date_changed? || @conference.end_date_changed?)\
|
||||||
|
&& @conference.email_settings.send_on_updated_conference_dates\
|
||||||
|
&& !@conference.email_settings.updated_conference_dates_subject.blank?\
|
||||||
|
&& @conference.email_settings.updated_conference_dates_template
|
||||||
|
|
||||||
@difficulty_levels_distribution = @conference.difficulty_levels_distribution
|
notify_on_conf_reg_dates_updates = (@conference.registration_start_date_changed? || @conference.registration_end_date_changed?)\
|
||||||
@difficulty_levels_distribution_confirmed = @conference.
|
&& @conference.email_settings.send_on_updated_conference_registration_dates\
|
||||||
difficulty_levels_distribution(:confirmed)
|
&& !@conference.email_settings.updated_conference_registration_dates_subject.blank?\
|
||||||
|
&& @conference.email_settings.updated_conference_registration_dates_template
|
||||||
|
|
||||||
@tracks_distribution = @conference.tracks_distribution
|
if @conference.update_attributes(params[:conference])
|
||||||
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
|
Mailbot.delay.conference_date_update_mail(@conference) if notify_on_conf_dates_updates
|
||||||
|
Mailbot.delay.conference_registration_date_update_mail(@conference) if notify_on_conf_reg_dates_updates
|
||||||
# Recent actions information
|
redirect_to(edit_admin_conference_path(id: @conference.short_title),
|
||||||
@recent_events = @conference.events.limit(5).order(created_at: :desc)
|
notice: 'Conference was successfully updated.')
|
||||||
@recent_registrations = @conference.registrations.limit(5).order(created_at: :desc)
|
else
|
||||||
|
redirect_to(edit_admin_conference_path(id: short_title),
|
||||||
@top_submitter = @conference.get_top_submitter
|
alert: 'Updating conference failed. ' \
|
||||||
|
"#{@conference.errors.full_messages.join('. ')}.")
|
||||||
# get targets
|
end
|
||||||
@registration_targets = @conference.get_targets(Target.units[:registrations])
|
|
||||||
@submission_targets = @conference.get_targets(Target.units[:submissions])
|
|
||||||
@program_minutes_targets = @conference.get_targets(Target.units[:program_minutes])
|
|
||||||
|
|
||||||
# get campaigns
|
|
||||||
@campaigns = @conference.get_campaigns
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
format.json { render json: @conference.to_json }
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
def show
|
||||||
@conferences = Conference.all
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
@conference = Conference.find_by(short_title: params[:id])
|
|
||||||
respond_to do |format|
|
# Overview and since last login information
|
||||||
format.html
|
@total_reg = @conference.registrations.count
|
||||||
format.json { render json: @conference.to_json }
|
@new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count
|
||||||
|
|
||||||
|
@total_submissions = @conference.events.count
|
||||||
|
@new_submissions = @conference.events.
|
||||||
|
where('created_at > ?', current_user.last_sign_in_at).count
|
||||||
|
|
||||||
|
@program_length = @conference.current_program_hours
|
||||||
|
@new_program_length = @conference.new_program_hours(current_user.last_sign_in_at)
|
||||||
|
|
||||||
|
# Step by step list
|
||||||
|
@conference_progress = @conference.get_status
|
||||||
|
|
||||||
|
# Line charts
|
||||||
|
@registrations = { @conference.short_title => @conference.get_registrations_per_week }
|
||||||
|
@registration_weeks = [0]
|
||||||
|
@registration_weeks.push(@registrations[@conference.short_title].length)
|
||||||
|
|
||||||
|
@registration_weeks = @registration_weeks.max
|
||||||
|
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
||||||
|
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
||||||
|
|
||||||
|
@submissions = Conference.get_event_state_line_colors
|
||||||
|
|
||||||
|
@submissions_data = {}
|
||||||
|
@submissions_data = @conference.get_submissions_data
|
||||||
|
@cfp_weeks = 0
|
||||||
|
if @submissions_data['Weeks']
|
||||||
|
@cfp_weeks = @submissions_data['Weeks']
|
||||||
|
@submissions_data = @submissions_data.except('Weeks')
|
||||||
|
end
|
||||||
|
|
||||||
|
# Doughnut charts
|
||||||
|
@event_type_distribution = @conference.event_type_distribution
|
||||||
|
@event_type_distribution_confirmed = @conference.event_type_distribution(:confirmed)
|
||||||
|
|
||||||
|
@difficulty_levels_distribution = @conference.difficulty_levels_distribution
|
||||||
|
@difficulty_levels_distribution_confirmed = @conference.
|
||||||
|
difficulty_levels_distribution(:confirmed)
|
||||||
|
|
||||||
|
@tracks_distribution = @conference.tracks_distribution
|
||||||
|
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
|
||||||
|
|
||||||
|
# Recent actions information
|
||||||
|
@recent_events = @conference.events.limit(5).order(created_at: :desc)
|
||||||
|
@recent_registrations = @conference.registrations.limit(5).order(created_at: :desc)
|
||||||
|
|
||||||
|
@top_submitter = @conference.get_top_submitter
|
||||||
|
|
||||||
|
# get targets
|
||||||
|
@registration_targets = @conference.get_targets(Target.units[:registrations])
|
||||||
|
@submission_targets = @conference.get_targets(Target.units[:submissions])
|
||||||
|
@program_minutes_targets = @conference.get_targets(Target.units[:program_minutes])
|
||||||
|
|
||||||
|
# get campaigns
|
||||||
|
@campaigns = @conference.get_campaigns
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
format.json { render json: @conference.to_json }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@conferences = Conference.all
|
||||||
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
format.json { render json: @conference.to_json }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
class Admin::DietchoicesController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class DietchoicesController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render :diets_list
|
render :diets_list
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
begin
|
begin
|
||||||
@conference.update_attributes!(params[:conference])
|
@conference.update_attributes!(params[:conference])
|
||||||
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), notice: 'Dietary choices were successfully updated.')
|
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), notice: 'Dietary choices were successfully updated.')
|
||||||
rescue => e
|
rescue => e
|
||||||
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), alert: "Dietary choices update failed: #{e.message}")
|
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), alert: "Dietary choices update failed: #{e.message}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,31 @@
|
||||||
class Admin::DifficultyLevelsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class DifficultyLevelsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @conference.update_attributes(params[:conference])
|
if @conference.update_attributes(params[:conference])
|
||||||
if !(@conference.difficulty_levels.count > 0) && @conference.use_difficulty_levels == true
|
if !(@conference.difficulty_levels.count > 0) && @conference.use_difficulty_levels == true
|
||||||
begin
|
begin
|
||||||
@conference.use_difficulty_levels = false
|
@conference.use_difficulty_levels = false
|
||||||
@conference.save!
|
@conference.save!
|
||||||
flash[:error] = "You cannot enable the usage of difficulty levels without having set any levels."
|
flash[:error] = "You cannot enable the usage of difficulty levels without having set any levels."
|
||||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||||
rescue ActiveRecord::RecordInvalid
|
rescue ActiveRecord::RecordInvalid
|
||||||
flash[:error] = "Something went wrong. Difficulty Levels update failed."
|
flash[:error] = "Something went wrong. Difficulty Levels update failed."
|
||||||
|
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
flash[:notice] = "Difficulty Levels were successfully updated."
|
||||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
flash[:notice] = "Difficulty Levels were successfully updated."
|
flash[:error] = "Difficulty Levels update failed."
|
||||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||||
end
|
end
|
||||||
else
|
|
||||||
flash[:error] = "Difficulty Levels update failed."
|
|
||||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
class Admin::EmailsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class Admin::EmailsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@conference.email_settings.update_attributes(params[:email_settings])
|
@conference.email_settings.update_attributes(params[:email_settings])
|
||||||
redirect_to(admin_conference_emails_path(
|
redirect_to(admin_conference_emails_path(
|
||||||
@conference.short_title),
|
@conference.short_title),
|
||||||
notice: 'Settings have been successfully updated.')
|
notice: 'Settings have been successfully updated.')
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@settings = @conference.email_settings
|
@settings = @conference.email_settings
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,20 @@
|
||||||
class Admin::EventtypesController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class EventtypesController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render :eventtypes
|
render :eventtypes
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@conference.update_attributes!(params[:conference])
|
@conference.update_attributes!(params[:conference])
|
||||||
redirect_to(admin_conference_eventtypes_path(
|
redirect_to(admin_conference_eventtypes_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
notice: 'Event types were successfully updated.')
|
notice: 'Event types were successfully updated.')
|
||||||
rescue => e
|
rescue => e
|
||||||
redirect_to(admin_conference_eventtypes_path(
|
redirect_to(admin_conference_eventtypes_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
alert: "Event types update failed: #{e.message}")
|
alert: "Event types update failed: #{e.message}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,96 +1,97 @@
|
||||||
class Admin::QuestionsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class QuestionsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
||||||
@questions_conference = @conference.questions
|
@questions_conference = @conference.questions
|
||||||
@new_question = @conference.questions.new
|
@new_question = @conference.questions.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@new_question = @conference.questions.new
|
@new_question = @conference.questions.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@question = @conference.questions.new(params[:question])
|
@question = @conference.questions.new(params[:question])
|
||||||
@question.conference_id = @conference.id
|
@question.conference_id = @conference.id
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @conference.save
|
if @conference.save
|
||||||
format.html { redirect_to admin_conference_questions_path, notice: 'Question was successfully created.' }
|
format.html { redirect_to admin_conference_questions_path, notice: 'Question was successfully created.' }
|
||||||
else
|
else
|
||||||
flash[:error] = "Oops, couldn't save. Question and answer(s) have titles?"
|
flash[:error] = "Oops, couldn't save. Question and answer(s) have titles?"
|
||||||
format.html { redirect_to admin_conference_questions_path }
|
format.html { redirect_to admin_conference_questions_path }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# GET questions/1/edit
|
# GET questions/1/edit
|
||||||
def edit
|
def edit
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@question = Question.find(params[:id])
|
|
||||||
|
|
||||||
if @question.global == true && !has_role?(current_user, "Admin")
|
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), alert: "Sorry, you cannot edit global questions. Create a new one.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# PUT questions/1
|
|
||||||
def update
|
|
||||||
|
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
|
||||||
@question = Question.find(params[:id])
|
|
||||||
|
|
||||||
if @question.update_attributes(params[:question])
|
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
|
||||||
else
|
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Update questions used for the conference
|
|
||||||
def update_conference
|
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
|
||||||
|
|
||||||
if @conference.update_attributes(params[:conference])
|
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated.")
|
|
||||||
else
|
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# DELETE questions/1
|
|
||||||
def destroy
|
|
||||||
if has_role?(current_user, "Admin")
|
|
||||||
@question = Question.find(params[:id])
|
@question = Question.find(params[:id])
|
||||||
|
|
||||||
# Do not delete global questions
|
if @question.global == true && !has_role?(current_user, "Admin")
|
||||||
if @question.global == false
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), alert: "Sorry, you cannot edit global questions. Create a new one.")
|
||||||
|
|
||||||
# Delete question and its answers
|
|
||||||
begin
|
|
||||||
Question.transaction do
|
|
||||||
|
|
||||||
@question.delete
|
|
||||||
@question.answers.each do |a|
|
|
||||||
a.delete
|
|
||||||
end
|
|
||||||
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map {|a| a.title}.join ','}"
|
|
||||||
end
|
|
||||||
rescue ActiveRecord::RecordInvalid
|
|
||||||
flash[:error] = "Could not delete question."
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:error] = "You cannot delete global questions."
|
|
||||||
end
|
end
|
||||||
else
|
|
||||||
flash[:error] = "You must be an admin to delete a question."
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
# PUT questions/1
|
||||||
@questions_conference = @conference.questions
|
def update
|
||||||
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
|
@question = Question.find(params[:id])
|
||||||
|
|
||||||
|
if @question.update_attributes(params[:question])
|
||||||
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
||||||
|
else
|
||||||
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Update questions used for the conference
|
||||||
|
def update_conference
|
||||||
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
|
|
||||||
|
if @conference.update_attributes(params[:conference])
|
||||||
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated.")
|
||||||
|
else
|
||||||
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE questions/1
|
||||||
|
def destroy
|
||||||
|
if has_role?(current_user, "Admin")
|
||||||
|
@question = Question.find(params[:id])
|
||||||
|
|
||||||
|
# Do not delete global questions
|
||||||
|
if @question.global == false
|
||||||
|
|
||||||
|
# Delete question and its answers
|
||||||
|
begin
|
||||||
|
Question.transaction do
|
||||||
|
|
||||||
|
@question.delete
|
||||||
|
@question.answers.each do |a|
|
||||||
|
a.delete
|
||||||
|
end
|
||||||
|
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map {|a| a.title}.join ','}"
|
||||||
|
end
|
||||||
|
rescue ActiveRecord::RecordInvalid
|
||||||
|
flash[:error] = "Could not delete question."
|
||||||
|
end
|
||||||
|
else
|
||||||
|
flash[:error] = "You cannot delete global questions."
|
||||||
|
end
|
||||||
|
else
|
||||||
|
flash[:error] = "You must be an admin to delete a question."
|
||||||
|
end
|
||||||
|
|
||||||
|
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
||||||
|
@questions_conference = @conference.questions
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
class Admin::RoomsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class RoomsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render :rooms_list
|
render :rooms_list
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @conference.update_attributes(params[:conference])
|
if @conference.update_attributes(params[:conference])
|
||||||
redirect_to(admin_conference_rooms_path(
|
redirect_to(admin_conference_rooms_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
notice: 'Rooms were successfully updated.')
|
notice: 'Rooms were successfully updated.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_rooms_path(
|
redirect_to(admin_conference_rooms_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
notice: 'Room update failed.')
|
notice: 'Room update failed.')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
class Admin::SocialEventsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class SocialEventsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render :social_events_list
|
render :social_events_list
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @conference.update_attributes(params[:conference])
|
if @conference.update_attributes(params[:conference])
|
||||||
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events were successfully updated.')
|
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events were successfully updated.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.')
|
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
class Admin::SupporterLevelsController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class SupporterLevelsController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render :supporter_levels
|
render :supporter_levels
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
begin
|
begin
|
||||||
@conference.update_attributes!(params[:conference])
|
@conference.update_attributes!(params[:conference])
|
||||||
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), notice: 'Supporter levels were successfully updated.')
|
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), notice: 'Supporter levels were successfully updated.')
|
||||||
rescue => e
|
rescue => e
|
||||||
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), alert: "Supporter levels update failed: #{e.message}")
|
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), alert: "Supporter levels update failed: #{e.message}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
class Admin::SupportersController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class SupportersController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render json: DatatableSupporters.new(@conference.supporter_registrations, view_context) }
|
format.json { render json: DatatableSupporters.new(@conference.supporter_registrations, view_context) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
params[:supporter_registration][:conference_id] = @conference.id
|
||||||
|
SupporterRegistration.create!(params[:supporter_registration])
|
||||||
|
redirect_to(admin_conference_supporters_path(conference_id: @conference.short_title), notice: "Supporter added")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
|
||||||
params[:supporter_registration][:conference_id] = @conference.id
|
|
||||||
SupporterRegistration.create!(params[:supporter_registration])
|
|
||||||
redirect_to(admin_conference_supporters_path(conference_id: @conference.short_title), notice: "Supporter added")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,24 @@
|
||||||
class Admin::TracksController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class TracksController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def show
|
def show
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :tracks_list }
|
format.html { render :tracks_list }
|
||||||
format.json { render json: @conference.tracks.to_json }
|
format.json { render json: @conference.tracks.to_json }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @conference.update_attributes(params[:conference])
|
if @conference.update_attributes(params[:conference])
|
||||||
redirect_to(admin_conference_tracks_path(
|
redirect_to(admin_conference_tracks_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
notice: 'Tracks were successfully updated.')
|
notice: 'Tracks were successfully updated.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_tracks_path(
|
redirect_to(admin_conference_tracks_path(
|
||||||
conference_id: @conference.short_title),
|
conference_id: @conference.short_title),
|
||||||
notice: 'Tracks update failed.')
|
notice: 'Tracks update failed.')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,32 @@
|
||||||
class Admin::VenueController < ApplicationController
|
module Admin
|
||||||
before_filter :verify_organizer
|
class VenueController < ApplicationController
|
||||||
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@venue = @conference.venue
|
@venue = @conference.venue
|
||||||
@venue.assign_attributes(params[:venue])
|
@venue.assign_attributes(params[:venue])
|
||||||
venue_notify = (@venue.name_changed? || @venue.address_changed?) &&
|
venue_notify = (@venue.name_changed? || @venue.address_changed?) &&
|
||||||
(!@venue.name.blank? && !@venue.address.blank?) &&
|
(!@venue.name.blank? && !@venue.address.blank?) &&
|
||||||
(@conference.email_settings.send_on_venue_update &&
|
(@conference.email_settings.send_on_venue_update &&
|
||||||
!@conference.email_settings.venue_update_subject.blank? &&
|
!@conference.email_settings.venue_update_subject.blank? &&
|
||||||
@conference.email_settings.venue_update_template)
|
@conference.email_settings.venue_update_template)
|
||||||
|
|
||||||
if @venue.update_attributes(params[:venue])
|
if @venue.update_attributes(params[:venue])
|
||||||
Mailbot.delay.send_email_on_venue_update(@conference) if venue_notify
|
Mailbot.delay.send_email_on_venue_update(@conference) if venue_notify
|
||||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||||
notice: 'Venue was successfully updated.')
|
notice: 'Venue was successfully updated.')
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||||
notice: 'Venue Updation Failed!')
|
notice: 'Venue Updation Failed!')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@venue = @conference.venue
|
||||||
|
render :venue_info
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
|
||||||
@venue = @conference.venue
|
|
||||||
render :venue_info
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,27 @@
|
||||||
class Admin::VolunteersController < ApplicationController
|
module Admin
|
||||||
def index
|
class VolunteersController < ApplicationController
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
def index
|
||||||
render :index
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
end
|
render :index
|
||||||
|
|
||||||
def show
|
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
|
||||||
if @conference.use_vpositions
|
|
||||||
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
|
||||||
else
|
|
||||||
@volunteers = @conference.registrations.where(volunteer: true)
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def show
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
begin
|
if @conference.use_vpositions
|
||||||
@conference.update_attributes!(params[:conference])
|
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
||||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: "Volunteering options were successfully updated.")
|
else
|
||||||
rescue => e
|
@volunteers = @conference.registrations.where(volunteer: true)
|
||||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}")
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
|
begin
|
||||||
|
@conference.update_attributes!(params[:conference])
|
||||||
|
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: "Volunteering options were successfully updated.")
|
||||||
|
rescue => e
|
||||||
|
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue