Add booth limit

This commit is contained in:
nasia 2017-07-28 21:46:48 +03:00 committed by nasia-sam
parent 703813248d
commit e73218b5ca
10 changed files with 66 additions and 18 deletions

View file

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

View file

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