diff --git a/app/models/event.rb b/app/models/event.rb index 48db7b98..daa8a39f 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -3,7 +3,7 @@ class Event < ActiveRecord::Base has_paper_trail attr_accessible :title, :subtitle, :abstract, :description, :event_type_id, :people_attributes, :person, :proposal_additional_speakers, :track_id, :video_id, :video_type, :require_registration, :difficulty_level_id - VIDEO_TYPE = [YOUTUBE = 'YouTube', SLIDE_SHARE = 'SlideShare'] + VIDEO_TYPE = [YOUTUBE = 'YouTube', SLIDE_SHARE = 'SlideShare', FLICKR = "Flickr"] validates :video_type, inclusion: {in: VIDEO_TYPE} diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index bbfcf713..0186e217 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -34,6 +34,7 @@ = f.input :video_type, :as => :select, :label => "Media Type", :collection => Event::VIDEO_TYPE, :include_blank => false %p{:class => "help-block media-type", :id => "youtube-help"} Go to your YouTube video, click on "share" and copy everything behind http://youtu.be/" %p{:class => "help-block media-type", :id => "slideshare-help", :style => "display:none"} Go to your SlideShare, click on "share" -> "embed" and copy the id + %p{:class => "help-block media-type", :id => "flickr-help", :style => "display:none"} Go to your image, click on "Grab the link" -> "Show short url" and copy everything behind https://flic.kr/p/ = f.input :video_id, :label => "Media ID", :as => :string %section#information diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index cc3f9d4f..1cbb64ac 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -35,6 +35,8 @@ %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -if @event.video_type == Event::SLIDE_SHARE %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.slideshare.net/slideshow/embed_code/#{@event.video_id}"} + -if @event.video_type == Event::FLICKR + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "flic.kr/p/#{@event.video_id}/player/268a054da2"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} .row-fluid