osem-fcy/app/views/admin/commercials/index.html.haml
chrisbr 58974d6914 Implement simplified commercials workflow
It's now possible to simply enter the url of the third party provider to enter a commercial.
2015-04-22 21:30:32 +02:00

38 lines
2 KiB
Text

.row
.col-md-12
.page-header
%h1 Commercials
%p.text-muted
Conference commercials will be displayed on the events in the
= link_to "schedule,", schedule_conference_path(@conference.short_title)
if the event speaker didn't add an event commercial.
- if can? :create, @conference.commercials.new
.row
.col-md-6
= semantic_form_for @commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { required: 'required' }, hint: 'Just paste the url of your video/photo provider'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right' }
.col-md-6
#resource-content
%hr
- @commercials.each_slice(3) do |slice|
.row
- slice.each do |commercial|
- if commercial.persisted?
.col-md-4
.thumbnail
.flexvideo{ id: "resource-content-#{commercial.id}"}
-# This is for backward compatibility
- if commercial.url
= Commercial.get_content(commercial.url).html_safe
- else
= render partial: 'shared/media_item', locals: { commercial_type: commercial.commercial_type, commercial_id: commercial.commercial_id }
.caption
- if can? :update, commercial
= semantic_form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider'
= f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update'
- if can? :destroy, commercial
= link_to 'Delete', admin_conference_commercial_path(@conference.short_title, commercial.id),
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'