Adding more registration options, and starting work on supporter levels

This commit is contained in:
Matt Barringer 2013-02-02 16:43:47 +01:00
parent 61a02d17a3
commit 973913b3bf
25 changed files with 228 additions and 20 deletions

View 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

View 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

View file

@ -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

View file

@ -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