Merge branch 'final_volunteers' of https://github.com/differentreality/osem into differentreality-final_volunteers
Conflicts: app/models/conference.rb app/models/registration.rb app/views/admin/conference/_sidebar.html.haml app/views/conference_registration/register.html.haml
This commit is contained in:
commit
14a896842b
31 changed files with 342 additions and 43 deletions
23
app/controllers/admin/volunteers_controller.rb
Normal file
23
app/controllers/admin/volunteers_controller.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class Admin::VolunteersController < ApplicationController
|
||||
def index
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
render :index
|
||||
end
|
||||
|
||||
def show
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@volunteers = @conference.registrations.joins(:vchoices).all
|
||||
end
|
||||
|
||||
def update
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
# @conference.update_attributes(params[:conference])
|
||||
# redirect_to admin_conference_volunteers_path(@conference.short_title)
|
||||
begin
|
||||
@conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_volunteer_options_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
||||
rescue Exception => e
|
||||
redirect_to(admin_conference_volunteer_options_path(:conference_id => params[:conference_id]), :alert => "Volunteering options update failed: #{e.message}")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue