diff --git a/app/views/admin/booth_types/_form.html.haml b/app/views/admin/booth_types/_form.html.haml new file mode 100644 index 00000000..a9ebb1f0 --- /dev/null +++ b/app/views/admin/booth_types/_form.html.haml @@ -0,0 +1,17 @@ +.row + .col-md-12 + .page-header + %h1 + - if booth_type.new_record? + New + #{(t'booth').capitalize} Type + = booth_type.title +.row + .col-md-12 + = semantic_form_for(booth_type, + url: (booth_type.new_record? ? admin_conference_program_booth_types_path : admin_conference_program_booth_type_path(conference, + booth_type))) do |f| + = f.input :title, input_html: { autofocus: true } + = f.input :description + %p.text-right + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/booth_types/edit.html.haml b/app/views/admin/booth_types/edit.html.haml new file mode 100644 index 00000000..04410a1f --- /dev/null +++ b/app/views/admin/booth_types/edit.html.haml @@ -0,0 +1,2 @@ += render 'form', booth_type: @booth_type, conference: @conference + diff --git a/app/views/admin/booth_types/index.html.haml b/app/views/admin/booth_types/index.html.haml new file mode 100644 index 00000000..a85d4c56 --- /dev/null +++ b/app/views/admin/booth_types/index.html.haml @@ -0,0 +1,29 @@ +.row + .col-md-12 + .page-header + %h1 #{(t'booth').capitalize} Types + %p.text-muted + The different types of #{(t 'booth').pluralize} in your conference +.row + .col-md-12 + %table.table.table-hover#track-types + %thead + %th Title + %th Description + %th Actions + %tbody + - @conference.program.booth_types.each do |booth_type| + %tr + %td + = booth_type.title + %td + = booth_type.description + %td + .btn-group{ role: 'group' } + = link_to 'Edit', edit_admin_conference_program_booth_type_path(@conference.short_title, booth_type.id), + method: :get, class: 'btn btn-primary' + = link_to 'Delete', admin_conference_program_booth_type_path(@conference.short_title, booth_type.id), + method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete #{booth_type.title}?" } +.row + .col-md-12.text-right + = link_to "Add #{(t'booth').capitalize} Type", new_admin_conference_program_booth_type_path(@conference.short_title), class: 'btn btn-primary' diff --git a/app/views/admin/booth_types/new.html.haml b/app/views/admin/booth_types/new.html.haml new file mode 100644 index 00000000..7b7892dd --- /dev/null +++ b/app/views/admin/booth_types/new.html.haml @@ -0,0 +1 @@ += render 'form', booth_type: @booth_type, conference: @conference diff --git a/app/views/admin/booths/index.html.haml b/app/views/admin/booths/index.html.haml index d5c02bdc..a852d839 100644 --- a/app/views/admin/booths/index.html.haml +++ b/app/views/admin/booths/index.html.haml @@ -62,6 +62,8 @@ %b Logo %th %b Title + %th + %b Type %th %b Submitter %th @@ -79,6 +81,8 @@ = image_tag(booth.picture.thumb.url, width: '20%') %td = link_to booth.title, admin_conference_booth_path(@conference.short_title, booth) + %td + = booth_type_dropdown(booth, @booth_types, @conference.short_title) %td = link_to booth.submitter.name, admin_user_path(booth.submitter) if booth.submitter %td diff --git a/app/views/admin/booths/show.html.haml b/app/views/admin/booths/show.html.haml index 02d44609..2b22599c 100644 --- a/app/views/admin/booths/show.html.haml +++ b/app/views/admin/booths/show.html.haml @@ -20,6 +20,11 @@ %b Reasoning %td = markdown(@booth.reasoning) + %tr + %td.col-md-2 + %b Type + %td + = booth_type_dropdown(@booth, @booth_types, @conference.short_title) %tr %td.col-md-2 %b Website diff --git a/app/views/booths/_form.html.haml b/app/views/booths/_form.html.haml index b9a0e511..af48212c 100644 --- a/app/views/booths/_form.html.haml +++ b/app/views/booths/_form.html.haml @@ -10,6 +10,14 @@ = 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 :booth_type_id, as: :select, + collection: conference.program.booth_types.map {|type| ["#{type.title}", type.id]}, + include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } if conference.program.booth_types.any? + + - conference.program.booth_types.each do |booth_type| + %span{ class: 'help-block select-help-text booth_booth_type_id collapse', id: "#{booth_type.id}-help" } + = booth_type.description = f.input :website_url = responsibles_selector_input f = f.input :invite_responsible, diff --git a/app/views/booths/show.html.haml b/app/views/booths/show.html.haml index 22634b0a..2dea7b4a 100644 --- a/app/views/booths/show.html.haml +++ b/app/views/booths/show.html.haml @@ -21,6 +21,11 @@ %b Reasoning %td = markdown(@booth.reasoning) + %tr + %td.col-md-2 + %b Type + %td + = @booth.booth_type.title %tr %td.col-md-2 %b Website