Add confirmed sponsors

This commit is contained in:
nasia 2017-08-27 15:42:52 +03:00
parent b770f9bd4d
commit 792a7fed1c
10 changed files with 162 additions and 65 deletions

View file

@ -1 +1,33 @@
= render 'edit_form'
.row
.col-md-12
.page-header
%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|
= f.input :name
= 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 :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' }
- @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}
.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' }