2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
|
|
|
|
class VolunteersController < ApplicationController
|
|
|
|
|
def index
|
|
|
|
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
|
|
|
|
render :index
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
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
|
2014-03-04 22:22:52 +02:00
|
|
|
end
|
2014-01-01 11:39:59 +02:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
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
|
2014-01-01 11:39:59 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|