Adding more registration options, and starting work on supporter levels
This commit is contained in:
parent
61a02d17a3
commit
973913b3bf
25 changed files with 228 additions and 20 deletions
17
app/controllers/admin/dietchoices_controller.rb
Normal file
17
app/controllers/admin/dietchoices_controller.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class Admin::DietchoicesController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
render :diets_list
|
||||
end
|
||||
|
||||
def update
|
||||
begin
|
||||
@conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_dietary_list_path(:conference_id => @conference.short_title), :notice => 'Dietary choices were successfully updated.')
|
||||
rescue Exception => e
|
||||
redirect_to(admin_conference_dietary_list_path(:conference_id => @conference.short_title), :alert => "Dietary choices update failed: #{e.message}")
|
||||
end
|
||||
end
|
||||
end
|
||||
17
app/controllers/admin/supporter_levels_controller.rb
Normal file
17
app/controllers/admin/supporter_levels_controller.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class Admin::SupporterLevelsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
render :supporter_levels
|
||||
end
|
||||
|
||||
def update
|
||||
begin
|
||||
@conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_supporter_levels_path(:conference_id => @conference.short_title), :notice => 'Supporter levels were successfully updated.')
|
||||
rescue Exception => e
|
||||
redirect_to(admin_conference_supporter_levels_path(:conference_id => @conference.short_title), :alert => "Supporter levels update failed: #{e.message}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -11,6 +11,8 @@ class ConferenceRegistrationController < ApplicationController
|
|||
@registered = false
|
||||
@registration = @person.registrations.new(:conference_id => @conference.id)
|
||||
end
|
||||
|
||||
@registration.supporter_registration ||= SupporterRegistration.new
|
||||
end
|
||||
|
||||
# TODO this is ugly
|
||||
|
|
|
|||
|
|
@ -18,16 +18,14 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
else
|
||||
params[:user].delete :password
|
||||
params[:user].delete :password_confirmation
|
||||
params[:user].delete :current_password
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
successfully_updated = if email_changed or password_changed
|
||||
@user.update_with_password(params[:user])
|
||||
else
|
||||
@user.update_without_password(params[:user])
|
||||
end
|
||||
if email_changed or password_changed
|
||||
successfully_updated = @user.update_with_password(params[:user])
|
||||
else
|
||||
successfully_updated = @user.update_without_password(params[:user])
|
||||
end
|
||||
|
||||
if successfully_updated
|
||||
set_flash_message :notice, :updated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue