Change fields and views
This commit is contained in:
parent
30e70cc5d6
commit
819d55366c
11 changed files with 73 additions and 65 deletions
7
app/views/admin/sponsors/_carrier_fields.html.haml
Normal file
7
app/views/admin/sponsors/_carrier_fields.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
.row
|
||||
.col-md-4
|
||||
= f.input :courrier_name, label: 'carrier\'s name', input_html: { name: "sponsor[swag_transportation][#{index}][carrier_name]", value: name_value }
|
||||
.col-md-4
|
||||
= f.input :tracking_number, input_html: { name: "sponsor[swag_transportation][#{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[swag_transportation][#{index}][boxes]", value: boxes_value }
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
.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: type_value }
|
||||
= f.input :type, label: 'Swag\'s type', input_html: { name: "sponsor[swag][#{index}][type]", value: type_value }
|
||||
.col-md-6
|
||||
= f.input :quantity, as: :number, in: 0...999, input_html: { name: "sponsor[swags][#{index}][quantity]", value: quantity_value}
|
||||
= f.input :quantity, as: :number, in: 0...9999, input_html: { name: "sponsor[swag][#{index}][quantity]", value: quantity_value}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,12 @@
|
|||
.col-md-8
|
||||
= semantic_form_for(@sponsor, url: admin_conference_sponsor_path(@conference.short_title, @sponsor)) do |f|
|
||||
= f.input :name
|
||||
= f.input :amount, as: :number, label: 'Donation amount'
|
||||
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
|
||||
= f.input :picture
|
||||
= f.input :website_url
|
||||
= f.input :sponsorship_level, collection: @conference.sponsorship_levels
|
||||
= f.input :address, label: 'Company\'s address'
|
||||
= f.input :address, label: 'Sponsor\'s address', hint: 'Please include the legal company name, along with the address, as you want it to be shown on the invoice'
|
||||
= f.input :vat, label: 'VAT Registration Number'
|
||||
%b Has Swags?
|
||||
= check_box_tag @conference.short_title, @sponsor.id, @sponsor.has_swag,
|
||||
|
|
@ -21,13 +22,13 @@
|
|||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
- @sponsor.swags.each_with_index do |(key, value), index|
|
||||
- @sponsor.swag.each_with_index do |(key, value), index|
|
||||
=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}
|
||||
- @sponsor.swag_transportation.each_with_index do |(key, value), index|
|
||||
=render partial: 'carrier_fields', locals: {f: f, index: index, name_value: value[:carrier_name].to_s, tracking_value: value[:tracking_number].to_s, boxes_value: value[:boxes]}
|
||||
=render partial: 'carrier_fields', locals: {f: f, index: @sponsor.carrier_index, name_value: nil, tracking_value: nil, boxes_value: nil}
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
%thead
|
||||
%th Logo
|
||||
%th Name
|
||||
%th Donation
|
||||
%th Payment
|
||||
%th Level
|
||||
%th Actions
|
||||
|
|
@ -34,6 +35,8 @@
|
|||
= image_tag(sponsor.picture.thumb.url, width: '20%')
|
||||
%td
|
||||
= link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor)
|
||||
%td
|
||||
= sponsor.amount
|
||||
%td
|
||||
- if sponsor.payed
|
||||
%span.fa.fa-check.text-success
|
||||
|
|
@ -88,17 +91,20 @@
|
|||
%span.fa.fa-times.text-danger
|
||||
%td
|
||||
- if sponsor.has_swag
|
||||
- sponsor.swags.each do |key, value|
|
||||
- sponsor.swag.each do |key, value|
|
||||
= value[:type]
|
||||
(
|
||||
= value[:quantity]
|
||||
)
|
||||
%br
|
||||
|
||||
%td
|
||||
- if sponsor.swag_received
|
||||
%span.fa.fa-check.text-success
|
||||
- else
|
||||
%span.fa.fa-times.text-danger
|
||||
= 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' }
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
|
||||
|
|
@ -135,7 +141,7 @@
|
|||
%td
|
||||
= truncate(sponsor.description)
|
||||
%td
|
||||
= sponsor.website_url
|
||||
= link_to sponsor.website_url, sponsor.website_url
|
||||
%td
|
||||
= sponsor.sponsorship_level.title
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@
|
|||
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the sponsor #{@sponsor.name}?" }
|
||||
.col-md-12
|
||||
%table.table
|
||||
%tr
|
||||
- if @sponsor.amount?
|
||||
%td.col-md-2
|
||||
%b Donation amount
|
||||
%td
|
||||
= @sponsor.amount
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Sponsorship paid?
|
||||
|
|
@ -47,13 +53,13 @@
|
|||
- if @sponsor.address?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Company's address
|
||||
%b Sponsor's address
|
||||
%td
|
||||
= @sponsor.address
|
||||
- if @sponsor.vat?
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Campany's VAT Registration Number
|
||||
%b Sponsor's VAT Registration Number
|
||||
%td
|
||||
= @sponsor.vat
|
||||
%tr
|
||||
|
|
@ -67,6 +73,20 @@
|
|||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
|
||||
|
||||
- if @sponsor.has_swag
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Swag's Type
|
||||
%td
|
||||
%b Quantity
|
||||
- @sponsor.swag.each do |key, value|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
= value[:type]
|
||||
%td
|
||||
= value[:quantity]
|
||||
|
||||
- if @sponsor.has_swag
|
||||
%tr
|
||||
%td.col-md-2
|
||||
|
|
@ -78,32 +98,10 @@
|
|||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
- if @sponsor.swag_index > 0
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Swag's Type
|
||||
%td
|
||||
%b Quantity
|
||||
- @sponsor.swags.each do |key, value|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
= value[:type]
|
||||
%td
|
||||
= value[:quantity]
|
||||
%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
|
||||
- if @sponsor.carrier_index > 0
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Courrier's name
|
||||
|
|
@ -111,10 +109,10 @@
|
|||
%b Tracking Number
|
||||
%td
|
||||
%b Number of boxes
|
||||
- @sponsor.courier_info.each do |key, value|
|
||||
- @sponsor.swag_transportation.each do |key, value|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
= value[:courier_name]
|
||||
= value[:carrier_name]
|
||||
%td
|
||||
= value[:tracking_number]
|
||||
%td
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue