Fixup the commericals dispaly, correct some labels
This commit is contained in:
parent
e0fd14e0ce
commit
8745825436
3 changed files with 22 additions and 23 deletions
|
|
@ -16,7 +16,7 @@
|
|||
= 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', autofocus: true },
|
||||
hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.'
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: 'Save Materials'
|
||||
%hr
|
||||
|
||||
- @commercials.each_slice(3) do |slice|
|
||||
|
|
@ -24,10 +24,10 @@
|
|||
- slice.each do |commercial|
|
||||
- if commercial.persisted?
|
||||
.col-md-4
|
||||
.thumbnail
|
||||
.flexvideo{ id: "resource-content-#{commercial.id}" }
|
||||
.panel
|
||||
%div{ id: "resource-content-#{commercial.id}" }
|
||||
= render partial: 'shared/media_item', locals: { commercial: commercial }
|
||||
.caption
|
||||
.caption.panel-footer
|
||||
- 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'
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@
|
|||
= semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f|
|
||||
= f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' },
|
||||
hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.'
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: 'Save Materials'
|
||||
%hr
|
||||
- @event.commercials.each_slice(3) do |slice|
|
||||
.row
|
||||
- slice.each do |commercial|
|
||||
- if commercial.persisted?
|
||||
.col-md-4
|
||||
.thumbnail
|
||||
.flexvideo{ id: "resource-content-#{commercial.id}"}
|
||||
.panel.panel-default
|
||||
%div{ id: "resource-content-#{commercial.id}"}
|
||||
= render partial: 'shared/media_item', locals: { commercial: commercial }
|
||||
.caption
|
||||
.caption.panel-footer
|
||||
- if can? :update, commercial
|
||||
= semantic_form_for commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f|
|
||||
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required', type: 'url' }
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
.flexvideo
|
||||
- if commercial.url
|
||||
- if commercial.commercial_type == 'SlideShare'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.slideshare.net/slideshow/embed_code/#{commercial.commercial_id}"}
|
||||
- elsif commercial.commercial_type == 'Flickr'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://flic.kr/p/#{commercial.commercial_id}/player/268a054da2"}
|
||||
- elsif commercial.commercial_type == 'Vimeo'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "//player.vimeo.com/video/#{commercial.commercial_id}"}
|
||||
- elsif commercial.commercial_type == 'Speakerdeck'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://speakerdeck.com/player/#{commercial.commercial_id}?"}
|
||||
- elsif commercial.commercial_type == 'Instagram'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', scrolling: 'no', allowtransparency: 'true', src: "//instagram.com/p/#{commercial.commercial_id}/embed/"}
|
||||
- elsif commercial.commercial_type == 'YouTube'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.youtube.com/embed/#{commercial.commercial_id}?rel=0"}
|
||||
- elsif commercial.url
|
||||
= Commercial.render_from_url(commercial.url)[:html]
|
||||
- else
|
||||
- if commercial.commercial_type == 'SlideShare'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.slideshare.net/slideshow/embed_code/#{commercial.commercial_id}"}
|
||||
- elsif commercial.commercial_type == 'Flickr'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://flic.kr/p/#{commercial.commercial_id}/player/268a054da2"}
|
||||
- elsif commercial.commercial_type == 'Vimeo'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "//player.vimeo.com/video/#{commercial.commercial_id}"}
|
||||
- elsif commercial.commercial_type == 'Speakerdeck'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://speakerdeck.com/player/#{commercial.commercial_id}?"}
|
||||
- elsif commercial.commercial_type == 'Instagram'
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', scrolling: 'no', allowtransparency: 'true', src: "//instagram.com/p/#{commercial.commercial_id}/embed/"}
|
||||
- else
|
||||
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.youtube.com/embed/#{commercial.commercial_id}?rel=0"}
|
||||
- if commercial.url
|
||||
%br
|
||||
= link_to('Open in a new tab', commercial.url, target: '_blank')
|
||||
= link_to('Open in a new tab', commercial.url, target: '_blank', class: 'btn btn-info')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue