2017-05-17 13:31:27 +03:00
.row
.col-md-12
.page-header
%h1
2019-07-22 00:59:17 +05:30
#{(t'booth').pluralize.capitalize }
2017-10-09 17:46:39 +05:30
.pull-right
- if can? :read, Booth
.btn-group
.btn-group
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
Export PDF
%span.caret
%ul.dropdown-menu{ role: 'menu' }
2019-07-22 00:59:17 +05:30
%li= link_to "All #{(t'booth').pluralize.capitalize }", admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'all')
%li= link_to "Confirmed #{(t'booth').pluralize.capitalize }", admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'confirmed')
2017-10-09 17:46:39 +05:30
.btn-group
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
Export CSV
%span.caret
%ul.dropdown-menu{ role: 'menu' }
%li= link_to 'All', admin_conference_booths_path(@conference.short_title, format: :csv, booth_export_option: 'all')
%li= link_to 'Confirmed', admin_conference_booths_path(@conference.short_title, format: :csv, booth_export_option: 'confirmed')
.btn-group
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
Export XLS
%span.caret
%ul.dropdown-menu{ role: 'menu' }
%li= link_to 'All', admin_conference_booths_path(@conference.short_title, format: :xlsx, booth_export_option: 'all')
%li= link_to 'Confirmed', admin_conference_booths_path(@conference.short_title, format: :xlsx, booth_export_option: 'confirmed')
2017-05-17 13:31:27 +03:00
= "(#{@booths.length})" if @booths.any?
%p.text-muted
2019-07-22 00:59:17 +05:30
All the #{t'booth'} requests
2017-07-28 21:46:48 +03:00
2017-05-17 13:31:27 +03:00
.row
.col-md-12
2017-07-28 21:46:48 +03:00
%h4
- if @conference.booth_limit == 0
%p
Set the
2019-07-22 00:59:17 +05:30
= link_to "#{(t'booth').capitalize } limit", edit_admin_conference_path(@conference.short_title)
to make sure you are not accepting more #{(t'booth').pluralize} than you can accommodate.
2017-07-28 21:46:48 +03:00
- elsif !@conference.maximum_accepted_booths?
%p
You cannot accept more than
%b
2019-07-22 00:59:17 +05:30
= pluralize(@conference.booth_limit, "#{t'booth'}")
2017-07-28 21:46:48 +03:00
(
2019-07-22 00:59:17 +05:30
= pluralize(@conference.booths.accepted.count + @conference.booths.confirmed.count, "accepted #{t'booth'}")
2017-07-28 21:46:48 +03:00
so far)
- else
%p
2019-07-22 00:59:17 +05:30
You have reached the maximum number of accepted #{(t'booth').pluralize}.
2017-07-28 21:46:48 +03:00
(
2019-07-22 00:59:17 +05:30
= link_to "#{@conference.booth_limit} #{(t'booth').pluralize}", edit_admin_conference_path(@conference.short_title)
2017-07-28 21:46:48 +03:00
)
2017-08-28 21:55:31 +05:30
- if @booths.any?
2019-08-13 16:48:32 +05:30
%br
= form_for(:booth, url: admin_conference_booths_state_path) do |f|
.row
.col-md-offset-3.col-md-4
= f.select :new_booth_state,
[],
{ include_blank: "Change same state #{(t'booth').pluralize} to other state (select #{(t'booth')} first)" }, { class: 'form-control center', onchange: 'this.form.submit()'}
%br
%table.datatable
%thead
%th
%b Select
%th
%b ID
%th
%b Logo
%th
%b Title
%th
%b Submitter
%th
%b Responsibles
%th
%b State
%th
%b Actions
- @booths.each do |booth|
%tr
%td
= f.radio_button :current_booth_state, booth.state, { onclick: "showOptions(#{booth.id})" }
%td
= booth.id
2017-08-28 21:55:31 +05:30
%td
2019-08-13 16:48:32 +05:30
- if booth.logo_link
= image_tag(booth.picture.thumb.url, width: '20%')
%td
= link_to booth.title, admin_conference_booth_path(@conference.short_title, booth)
%td
= link_to booth.submitter.name, admin_user_path(booth.submitter) if booth.submitter
%td
.responsibles
- booth.responsibles.each_with_index do |responsible, i|
= link_to responsible.name, admin_user_path(responsible)
= ", " unless i == booth.responsibles.length - 1
%td
.btn-group
%button{ type: 'button', class: 'btn btn-link dropdown-toggle', 'data-toggle' => 'dropdown' }
= booth.state.humanize
%span.caret
%ul.dropdown-menu{ role: 'menu' }
= render 'change_state_dropdown', booth: booth
%td
= link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, booth.id),
class: 'btn btn-primary'
2017-08-28 21:44:39 +05:30
.row
.col-md-12.text-right
- if can? :create, Booth
= link_to 'New Booth', new_admin_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
2019-08-13 16:48:32 +05:30
:javascript
function showOptions(booth_id){
var states = document.getElementsByClassName("common_booth_" + booth_id);
var select_tag = $('#booth_new_booth_state');
$('#booth_new_booth_state option:not(:first)').remove();
for (var state = 0; state < states.length; state++ ){
select_tag.append($("<option></option>").text(states[state].textContent));
}
}