2017-08-27 15:42:52 +03:00
.row
.col-md-12
.page-header
%h1
Edit
= @sponsor.name
.row
.col-md-8
= semantic_form_for(@sponsor, url: admin_conference_sponsor_path(@conference.short_title, @sponsor)) do |f|
= f.input :name
2017-08-28 15:24:51 +03:00
= f.input :amount, as: :number, label: 'Donation amount'
2017-08-31 22:04:12 +03:00
%b Sponsorship paid?
= check_box_tag @conference.short_title, @sponsor.id, @sponsor.paid,
method: :patch, url: "/admin/conferences/#{@conference.short_title}/sponsors/#{@sponsor.id}?sponsor[paid]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
off_text: 'No' }
= f.input :responsible_name, label: 'Responsible\'s name', hint: 'The person with whom you are in contact', input_html: { name: 'sponsor[responsibe][responsible_name]', value: @sponsor.responsibe[:responsible_name] }
= f.input :responsible_name, label: 'Responsible\'s email', input_html: { name: 'sponsor[responsibe][responsible_email]', value: @sponsor.responsibe[:responsible_email] }
2017-08-27 15:42:52 +03:00
= 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
2017-08-28 15:24:51 +03:00
= 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'
2017-08-27 15:42:52 +03:00
= f.input :vat, label: 'VAT Registration Number'
%b Has Swags?
= check_box_tag @conference.short_title, @sponsor.id, @sponsor.has_swag,
method: :patch, url: "/admin/conferences/#{@conference.short_title}/sponsors/#{@sponsor.id}?sponsor[has_swag]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
off_text: 'No' }
2017-08-28 15:24:51 +03:00
- @sponsor.swag.each_with_index do |(key, value), index|
2017-08-28 22:10:08 +03:00
= 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}
2017-08-27 23:40:32 +03:00
2017-08-31 22:04:12 +03:00
%b Swag received?
= 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' }
2017-08-28 15:24:51 +03:00
- @sponsor.swag_transportation.each_with_index do |(key, value), index|
2017-08-28 22:10:08 +03:00
= 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}
2017-08-27 23:40:32 +03:00
2017-08-27 15:42:52 +03:00
.row
.col-md-8
= image_tag f.object.picture.thumb.url if f.object.picture?
= f.input :picture
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }