add courier info
This commit is contained in:
parent
792a7fed1c
commit
30e70cc5d6
10 changed files with 146 additions and 95 deletions
7
app/views/admin/sponsors/_courier_fields.html.haml
Normal file
7
app/views/admin/sponsors/_courier_fields.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
.row
|
||||
.col-md-4
|
||||
= f.input :courrier_name, label: 'Courier\'s name', input_html: { name: "sponsor[courier_info][#{index}][courier_name]", value: name_value }
|
||||
.col-md-4
|
||||
= f.input :tracking_number, input_html: { name: "sponsor[courier_info][#{index}][tracking_number]", value: tracking_value}
|
||||
.col-md-4
|
||||
= f.input :boxes, as: :number, in: 0...999, label: 'Number of boxes', input_html: { name: "sponsor[courier_info][#{index}][boxes]", value: boxes_value }
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
.row
|
||||
.col-md-6
|
||||
= f.input :type, label: 'Swag\'s type', input_html: { name: "sponsor[swags][#{index}][type]", value: v_type }
|
||||
= f.input :type, label: 'Swag\'s type', input_html: { name: "sponsor[swags][#{index}][type]", value: type_value }
|
||||
.col-md-6
|
||||
= f.input :quantity, as: :number, in: 0...999, input_html: { name: "sponsor[swags][#{index}][quantity]", value: v_quantity}
|
||||
= f.input :quantity, as: :number, in: 0...999, input_html: { name: "sponsor[swags][#{index}][quantity]", value: quantity_value}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
%h1
|
||||
Edit
|
||||
= @sponsor.name
|
||||
= @sponsor.swag_index
|
||||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@sponsor, url: admin_conference_sponsor_path(@conference.short_title, @sponsor)) do |f|
|
||||
|
|
@ -23,8 +22,13 @@
|
|||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
- @sponsor.swags.each_with_index do |(key, value), index|
|
||||
=render partial: 'swag_fields', locals: {f: f, index: index, v_type: value[:type].to_s, v_quantity: value[:quantity].to_i}
|
||||
=render partial: 'swag_fields', locals: {f: f, index: @sponsor.swag_index, v_type: nil, v_quantity: 0}
|
||||
=render partial: 'swag_fields', locals: {f: f, index: index, type_value: value[:type].to_s, quantity_value: value[:quantity].to_i}
|
||||
=render partial: 'swag_fields', locals: {f: f, index: @sponsor.swag_index, type_value: nil, quantity_value: nil}
|
||||
|
||||
- @sponsor.courier_info.each_with_index do |(key, value), index|
|
||||
=render partial: 'courier_fields', locals: {f: f, index: index, name_value: value[:courier_name].to_s, tracking_value: value[:tracking_number].to_s, boxes_value: value[:boxes]}
|
||||
=render partial: 'courier_fields', locals: {f: f, index: @sponsor.courier_index, name_value: nil, tracking_value: nil, boxes_value: nil}
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
= image_tag f.object.picture.thumb.url if f.object.picture?
|
||||
|
|
|
|||
|
|
@ -13,19 +13,18 @@
|
|||
%li
|
||||
%a{'data-toggle' => 'tab', href: '#swags', role: 'tab'} Swags
|
||||
%li
|
||||
%a{'data-toggle' => 'tab', href: '#uncofirmed', role: 'tab'} Unconfirmed
|
||||
%a{'data-toggle' => 'tab', href: '#unconfirmed', role: 'tab'} Unconfirmed
|
||||
|
||||
.tab-content
|
||||
#sponsorship.tab-pane.active
|
||||
- if @conference.sponsors.confirmed.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#sponsors
|
||||
%table.table.table-hover#sponsorship
|
||||
%thead
|
||||
%th Logo
|
||||
%th Name
|
||||
%th Description
|
||||
%th URL
|
||||
%th Payment
|
||||
%th Level
|
||||
%th Actions
|
||||
%tbody
|
||||
|
|
@ -36,9 +35,10 @@
|
|||
%td
|
||||
= link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor)
|
||||
%td
|
||||
= truncate(sponsor.description)
|
||||
%td
|
||||
= sponsor.website_url
|
||||
- if sponsor.payed
|
||||
%span.fa.fa-check.text-success
|
||||
- else
|
||||
%span.fa.fa-times.text-danger
|
||||
%td
|
||||
= sponsor.sponsorship_level.title
|
||||
%td
|
||||
|
|
@ -52,13 +52,14 @@
|
|||
method: :patch, class: 'btn btn-mini btn-success'
|
||||
- if sponsor.transition_possible? :cancel
|
||||
= link_to 'Cancel', cancel_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-default'
|
||||
|
||||
method: :patch, class: 'btn btn-mini btn-warning'
|
||||
- else
|
||||
%p No confirmed sponsors yet!
|
||||
#swags.tab-pane
|
||||
- if @conference.sponsors.confirmed.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#sponsors
|
||||
%table.table.table-hover#swags
|
||||
%thead
|
||||
%th Logo
|
||||
%th Name
|
||||
|
|
@ -71,7 +72,8 @@
|
|||
- @conference.sponsors.confirmed.each do |sponsor|
|
||||
%tr
|
||||
%td
|
||||
= image_tag(sponsor.picture.thumb.url, width: '20%')
|
||||
- if sponsor.picture?
|
||||
= image_tag(sponsor.picture.thumb.url, width: '20%')
|
||||
%td
|
||||
= link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor)
|
||||
%td
|
||||
|
|
@ -96,7 +98,7 @@
|
|||
- if sponsor.swag_received
|
||||
%span.fa.fa-check.text-success
|
||||
- else
|
||||
%span.fa.fa-times
|
||||
%span.fa.fa-times.text-danger
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
|
|
@ -108,47 +110,48 @@
|
|||
method: :patch, class: 'btn btn-mini btn-success'
|
||||
- if sponsor.transition_possible? :cancel
|
||||
= link_to 'Cancel', cancel_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-default'
|
||||
|
||||
.tab-content
|
||||
#unconfirmed.tab-pane
|
||||
- if @conference.sponsors.unconfirmed.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#sponsors
|
||||
%thead
|
||||
%th Logo
|
||||
%th Name
|
||||
%th Description
|
||||
%th URL
|
||||
%th Level
|
||||
%th Actions
|
||||
%tbody
|
||||
- @conference.sponsors.unconfirmed.each do |sponsor|
|
||||
%tr
|
||||
%td
|
||||
= image_tag(sponsor.picture.thumb.url, width: '20%')
|
||||
%td
|
||||
= link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor)
|
||||
%td
|
||||
= truncate(sponsor.description)
|
||||
%td
|
||||
= sponsor.website_url
|
||||
%td
|
||||
= sponsor.sponsorship_level.title
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
method: :get, class: 'btn btn-mini btn-primary'
|
||||
= link_to 'Delete', admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
method: :delete, class: 'btn btn-mini btn-danger', data: { confirm: "Do you really want to delete the sponsor #{sponsor.name}?" }
|
||||
- if sponsor.transition_possible? :confirm
|
||||
= link_to 'Confirm', confirm_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-success'
|
||||
- if sponsor.transition_possible? :cancel
|
||||
= link_to 'Cancel', cancel_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-default'
|
||||
|
||||
method: :patch, class: 'btn btn-mini btn-warning'
|
||||
- else
|
||||
%p No confirmed sponsors yet!
|
||||
#unconfirmed.tab-pane
|
||||
- if @conference.sponsors.unconfirmed.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#unconfirmed
|
||||
%thead
|
||||
%th Logo
|
||||
%th Name
|
||||
%th Description
|
||||
%th URL
|
||||
%th Level
|
||||
%th Actions
|
||||
%tbody
|
||||
- @conference.sponsors.unconfirmed.each do |sponsor|
|
||||
%tr
|
||||
%td
|
||||
= image_tag(sponsor.picture.thumb.url, width: '20%')
|
||||
%td
|
||||
= link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor)
|
||||
%td
|
||||
= truncate(sponsor.description)
|
||||
%td
|
||||
= sponsor.website_url
|
||||
%td
|
||||
= sponsor.sponsorship_level.title
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
method: :get, class: 'btn btn-mini btn-primary'
|
||||
= link_to 'Delete', admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
method: :delete, class: 'btn btn-mini btn-danger', data: { confirm: "Do you really want to delete the sponsor #{sponsor.name}?" }
|
||||
- if sponsor.transition_possible? :confirm
|
||||
= link_to 'Confirm', confirm_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-success'
|
||||
- if sponsor.transition_possible? :cancel
|
||||
= link_to 'Cancel', cancel_admin_conference_sponsor_path(@conference.short_title, sponsor.id),
|
||||
method: :patch, class: 'btn btn-mini btn-warning'
|
||||
- else
|
||||
%p There are no unconfirmed sponsors
|
||||
.row
|
||||
.col-md-12
|
||||
= link_to 'Add Sponsor', new_admin_conference_sponsor_path(@conference.short_title), class: 'btn btn-primary pull-right'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h2
|
||||
= image_tag(@sponsor.picture.thumb.url, size: '20%', alt: '')
|
||||
- if @sponsor.picture?
|
||||
= image_tag(@sponsor.picture.thumb.url, size: '20%', alt: '')
|
||||
= @sponsor.name
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
@ -41,6 +42,20 @@
|
|||
%b Website url
|
||||
%td
|
||||
= link_to @sponsor.website_url, @sponsor.website_url
|
||||
|
||||
|
||||
- if @sponsor.address?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Company's address
|
||||
%td
|
||||
= @sponsor.address
|
||||
- if @sponsor.vat?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Campany's VAT Registration Number
|
||||
%td
|
||||
= @sponsor.vat
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Has swag?
|
||||
|
|
@ -75,15 +90,32 @@
|
|||
= value[:type]
|
||||
%td
|
||||
= value[:quantity]
|
||||
- if @sponsor.address?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Company's address
|
||||
%td
|
||||
= @sponsor.address
|
||||
- if @sponsor.vat?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Campany's VAT Registration Number
|
||||
%td
|
||||
= @sponsor.vat
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Swag Received?
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @sponsor.id, @sponsor.swag_received,
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/sponsors/#{@sponsor.id}?sponsor[swag_received]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table
|
||||
- if @sponsor.courier_index > 0
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Courrier's name
|
||||
%td.col-md-2
|
||||
%b Tracking Number
|
||||
%td
|
||||
%b Number of boxes
|
||||
- @sponsor.courier_info.each do |key, value|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
= value[:courier_name]
|
||||
%td
|
||||
= value[:tracking_number]
|
||||
%td
|
||||
= value[:boxes]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue