Add booths to non admin
This commit is contained in:
parent
033dbe4c40
commit
32c5af2a17
22 changed files with 426 additions and 86 deletions
|
|
@ -1,33 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%title Request a Booth
|
||||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@booth, url: @booth.new_record? ? admin_conference_booths_path(@conference.short_title) : admin_conference_booth_path(@conference.short_title, @booth.id), html: { multipart: true }) do |f|
|
||||
= f.input :title, as: :string, autofocus: true, required: true
|
||||
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
hint: 'This field becomes public upon request acceptance'
|
||||
= f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
label: 'How it fits the conference'
|
||||
= f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
label: 'Submitter\'s relation',
|
||||
hint: 'e.g. employee, comunity manager, etc'
|
||||
= f.input :website_url
|
||||
= responsibles_selector_input f
|
||||
= image_tag f.object.picture.thumb.url if f.object.picture?
|
||||
= f.input :picture
|
||||
|
||||
%p.text-right
|
||||
- if @booth.new_record?
|
||||
= f.submit 'Create Booth Request', class: 'btn btn-success'
|
||||
- else
|
||||
= f.submit 'Update Booth Request', class: 'btn btn-success'
|
||||
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
$('#booth_responsible_ids').selectize({
|
||||
plugins: ['remove_button'],
|
||||
minItems: 2
|
||||
} )
|
||||
});
|
||||
|
|
@ -2,4 +2,4 @@
|
|||
Editing
|
||||
= @booth.title
|
||||
|
||||
= render 'form'
|
||||
= render 'booths/form'
|
||||
|
|
|
|||
|
|
@ -41,8 +41,9 @@
|
|||
= link_to booth.submitter.name, admin_user_path(booth.submitter) if booth.submitter
|
||||
%td
|
||||
.responsibles
|
||||
- booth.responsibles.each do |responsible|
|
||||
- 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' }
|
||||
|
|
@ -51,9 +52,5 @@
|
|||
%ul.dropdown-menu{ role: 'menu' }
|
||||
= render 'change_state_dropdown', booth: booth
|
||||
%td
|
||||
.btn-group{ role: "group" }
|
||||
= link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, booth.id),
|
||||
class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_booth_path(@conference.short_title, booth.id),
|
||||
method: :delete, class: 'btn btn-danger',
|
||||
data: {confirm: "Do you really want to delete this booth request?"}
|
||||
= link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, booth.id),
|
||||
class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
%h1 New booth
|
||||
|
||||
= render 'form'
|
||||
= render 'booths/form'
|
||||
|
|
|
|||
|
|
@ -39,12 +39,13 @@
|
|||
%td.col-md-2
|
||||
%b Responsibles
|
||||
%td
|
||||
- @booth.responsibles.each do |responsibles|
|
||||
- @booth.responsibles.each_with_index do |responsibles, i|
|
||||
.responsibles
|
||||
= link_to responsibles.name, admin_user_path(responsibles)
|
||||
(
|
||||
= responsibles.email
|
||||
)
|
||||
= " , " unless i == @booth.responsibles.length - 1
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Submitted on
|
||||
|
|
|
|||
30
app/views/booths/_form.html.haml
Normal file
30
app/views/booths/_form.html.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@booth, url: @url, html: { multipart: true }) do |f|
|
||||
= f.input :title, as: :string, autofocus: true, required: true
|
||||
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
hint: 'This field becomes public upon request acceptance'
|
||||
= f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
label: 'How it fits the conference'
|
||||
= f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
|
||||
label: 'Submitter\'s relation',
|
||||
hint: 'e.g. employee, comunity manager, etc'
|
||||
= f.input :website_url
|
||||
= responsibles_selector_input f
|
||||
= image_tag f.object.picture.thumb.url if f.object.picture?
|
||||
= f.input :picture
|
||||
|
||||
%p.text-right
|
||||
- if @booth.new_record?
|
||||
= f.submit 'Create Booth Request', class: 'btn btn-success'
|
||||
- else
|
||||
= f.submit 'Update Booth Request', class: 'btn btn-success'
|
||||
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
$('#booth_responsible_ids').selectize({
|
||||
plugins: ['remove_button'],
|
||||
minItems: 2
|
||||
} )
|
||||
});
|
||||
6
app/views/booths/edit.html.haml
Normal file
6
app/views/booths/edit.html.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
.container
|
||||
%h1
|
||||
Editing
|
||||
= @booth.title
|
||||
|
||||
= render 'form'
|
||||
51
app/views/booths/index.html.haml
Normal file
51
app/views/booths/index.html.haml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12.page-header
|
||||
%h1
|
||||
Your booth requests for
|
||||
= @conference.title
|
||||
.row
|
||||
.col-md-12
|
||||
.margin-booth-table
|
||||
%table.table.table-striped.table-hover
|
||||
%thead
|
||||
%th
|
||||
%b State
|
||||
%th
|
||||
%b Logo
|
||||
%th
|
||||
%b Title
|
||||
%th
|
||||
%b Actions
|
||||
- @booths.each do |booth|
|
||||
%tr
|
||||
%td{ style: "padding:20px 8px 20px 8px;" }
|
||||
- if (booth.state == 'to_accept' || booth.state == 'to_reject')
|
||||
- show_state = 'new'
|
||||
- else
|
||||
- show_state = booth.state
|
||||
%span{ title: show_state, class: "fa #{booth_status_icon(booth)}" }
|
||||
%td
|
||||
- if booth.logo_link
|
||||
= image_tag(booth.picture.thumb.url, width: '20%')
|
||||
%td
|
||||
= link_to booth.title, conference_booth_path(@conference.short_title, booth)
|
||||
%td
|
||||
-if can? :edit, booth
|
||||
= link_to 'Edit', edit_conference_booth_path(@conference.short_title, booth.id),
|
||||
class: 'btn btn-default'
|
||||
- if booth.transition_possible? :withdraw
|
||||
= link_to 'Withdraw',
|
||||
withdraw_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, class: 'btn btn-mini btn-warning', id: "withdraw_booth_#{booth.id}",
|
||||
data: { confirm: 'Are you sure you really want to withdraw this request?' }
|
||||
- if booth.transition_possible? :confirm
|
||||
= link_to 'Confirm',
|
||||
confirm_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, class: 'btn btn-mini btn-success', id: "confirm_booth_#{booth.id}"
|
||||
- if booth.transition_possible? :restart
|
||||
= link_to 'Re-submit',
|
||||
restart_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, class: 'btn btn-mini btn-success', id: "restart_booth_#{booth.id}"
|
||||
.pull-right
|
||||
= link_to 'Add Booth', new_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
|
||||
4
app/views/booths/new.html.haml
Normal file
4
app/views/booths/new.html.haml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.container
|
||||
%h1 Request a booth
|
||||
|
||||
= render 'form'
|
||||
60
app/views/booths/show.html.haml
Normal file
60
app/views/booths/show.html.haml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12
|
||||
%h3
|
||||
- if @booth.logo_link
|
||||
= image_tag(@booth.picture.thumb.url, size: '20%', alt: '')
|
||||
= @booth.title
|
||||
.btn-group.pull-right
|
||||
= link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, @booth), class: 'btn btn-mini btn-primary'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Description
|
||||
%td
|
||||
= markdown(@booth.description)
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Reasoning
|
||||
%td
|
||||
= markdown(@booth.reasoning)
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Website
|
||||
%td
|
||||
- if @booth.website_url.present?
|
||||
= link_to @booth.website_url, @booth.website_url
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Submitter
|
||||
%td
|
||||
= link_to @booth.submitter.name, user_path(@booth.submitter)
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Submitter's relationship
|
||||
%td
|
||||
= @booth.submitter_relationship
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Responsibles
|
||||
%td
|
||||
- @booth.responsibles.each_with_index do |responsibles, i|
|
||||
.responsibles
|
||||
= link_to responsibles.name, user_path(responsibles)
|
||||
(
|
||||
= responsibles.email
|
||||
)
|
||||
= ", " unless i == @booth.responsibles.length - 1
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Submitted on
|
||||
%td
|
||||
= @booth.created_at
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Last updated on
|
||||
%td
|
||||
= @booth.updated_at
|
||||
Loading…
Add table
Add a link
Reference in a new issue