Add registration_limit to conference model. Added the input for registration limit in the edit conference form. In the controller, if the limit has exceeded redirect to root_path with an alert. fix #761
This commit is contained in:
parent
2034c0f965
commit
28fbc518f3
12 changed files with 124 additions and 16 deletions
|
|
@ -211,7 +211,7 @@ module Admin
|
|||
:vpositions_attributes, :use_volunteers, :color,
|
||||
:sponsorship_levels_attributes, :sponsors_attributes,
|
||||
:photos_attributes, :targets, :targets_attributes,
|
||||
:campaigns, :campaigns_attributes)
|
||||
:campaigns, :campaigns_attributes, :registration_limit)
|
||||
end
|
||||
|
||||
def get_users(role_name)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
redirect_to edit_conference_conference_registrations_path(@conference.short_title)
|
||||
end
|
||||
|
||||
if @conference.registration_limit_exceeded?
|
||||
redirect_to root_path, alert: "Sorry, registration limit exceeded for #{@conference.title}"
|
||||
return
|
||||
end
|
||||
|
||||
@registration = Registration.new
|
||||
|
||||
# @user variable needs to be set so that _sign_up_form_embedded works properly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue