2014-01-01 11:39:59 +02:00
|
|
|
class Admin::VolunteersController < ApplicationController
|
|
|
|
|
def index
|
2014-04-27 16:27:29 +02:00
|
|
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
2014-01-01 11:39:59 +02:00
|
|
|
render :index
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
2014-04-27 16:27:29 +02:00
|
|
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
2014-03-04 22:22:52 +02:00
|
|
|
if @conference.use_vpositions
|
|
|
|
|
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
|
|
|
|
else
|
2014-07-21 14:49:05 +02:00
|
|
|
@volunteers = @conference.registrations.where(volunteer: true)
|
2014-03-04 22:22:52 +02:00
|
|
|
end
|
2014-01-01 11:39:59 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
2014-04-27 16:27:29 +02:00
|
|
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
2014-03-04 10:30:23 +01:00
|
|
|
begin
|
2014-01-01 11:39:59 +02:00
|
|
|
@conference.update_attributes!(params[:conference])
|
2014-07-21 14:49:05 +02:00
|
|
|
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: "Volunteering options were successfully updated.")
|
2014-07-21 14:37:26 +02:00
|
|
|
rescue => e
|
2014-07-21 14:49:05 +02:00
|
|
|
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}")
|
2014-01-01 11:39:59 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|