Add booth limit
This commit is contained in:
parent
703813248d
commit
e73218b5ca
10 changed files with 66 additions and 18 deletions
|
|
@ -1,11 +1,13 @@
|
|||
- if booth.transition_possible? :accept
|
||||
- if @conference.email_settings.send_on_booths_acceptance
|
||||
- link = 'Accept with email'
|
||||
- else
|
||||
- link = 'Accept booth'
|
||||
%li= link_to link,
|
||||
accept_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch ,id: "accept_booth_#{booth.id}"
|
||||
- if can? :accept, @booth
|
||||
- if @conference.email_settings.send_on_booths_acceptance
|
||||
- link = 'Accept with email'
|
||||
- else
|
||||
- link = 'Accept booth'
|
||||
%li= link_to link,
|
||||
accept_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch ,id: "accept_booth_#{booth.id}",
|
||||
data: (@conference.booth_limit > 0 ? { confirm: 'You are able to accept '+ pluralize(@conference.booth_limit - @conference.booths.accepted.count, 'more booth') + " (booth limit set to #{@conference.booth_limit}). Are you sure you want to accept this one?" } : nil )
|
||||
|
||||
- if booth.transition_possible? :reject
|
||||
- if @conference.email_settings.send_on_booths_rejection
|
||||
|
|
|
|||
|
|
@ -9,8 +9,30 @@
|
|||
= link_to 'Add Booth', new_admin_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
|
||||
%p.text-muted
|
||||
All the booth requests
|
||||
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
%h4
|
||||
- if @conference.booth_limit == 0
|
||||
%p
|
||||
Set the
|
||||
= link_to 'Booth limit', edit_admin_conference_path(@conference.short_title)
|
||||
to make sure you are not accepting more booths than you can accommodate.
|
||||
- elsif !@conference.maximum_accepted_booths?
|
||||
%p
|
||||
You cannot accept more than
|
||||
%b
|
||||
= pluralize(@conference.booth_limit, 'booth')
|
||||
(
|
||||
= pluralize(@conference.booths.accepted.count + @conference.booths.confirmed.count, 'accepted booth')
|
||||
so far)
|
||||
- else
|
||||
%p
|
||||
You have reached the maximum number of accepted booths.
|
||||
(
|
||||
= link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title)
|
||||
)
|
||||
.margin-booth-table
|
||||
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||
%thead
|
||||
|
|
|
|||
|
|
@ -26,4 +26,7 @@
|
|||
= f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24}
|
||||
= f.inputs name: 'Registrations' do
|
||||
= f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration')
|
||||
= f.inputs name: 'Booths' do
|
||||
= f.input :booth_limit, as: :number, in: 0..9999,
|
||||
hint: 'Booth limit is the maximum number of booths that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more booths than the conference can accommodate. You currently have ' + pluralize(@conference.booths.accepted.count, 'accepted booth') +'.'
|
||||
= f.action :submit, as: :button, button_html: {class: 'btn btn-primary'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue