From 2ccd37a7afa71647291de7e3e2b3f4a6bb66747f Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Mon, 10 Mar 2014 18:40:32 +0100 Subject: [PATCH 1/8] Add request.ssl check in proposal view to fix mixed content issue for embedded youtube video close #1 --- app/views/proposal/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index f1bd4a28..9e0bc20d 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -31,9 +31,9 @@ .row-fluid .span12.flexvideo -if @event.video_id - %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/#{@event.video_id}?rel=0"} + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -else - %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} .row-fluid .span8 %h3 From 2421eaf4ea05518f71d2e048510068cd416713c2 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sat, 15 Mar 2014 20:21:01 +0100 Subject: [PATCH 2/8] Implements more embed codes for events - add slideshare embed code TODO: - review help texts - refactor video_type collection to event model enumeration - add more embed code (flickr, instagram, myvideo) - video_type and video_id is now more like media_type and media_id -> it should considered to rename these attributes #26 --- app/assets/javascripts/osem.js | 7 +++++++ app/views/proposal/_proposal_form.html.haml | 6 +++++- app/views/proposal/show.html.haml | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index 21dd66c8..989b00db 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -1,4 +1,9 @@ $(function() { + $("#event_video_type").change(function () { + $(".media-type").hide(); + $('#' + $(this).val() + '-help').show(); + }); + $('.dropdown-toggle').dropdown(); $("#conference-start-datepicker").datepicker({ dateFormat: 'yy/mm/dd', @@ -252,3 +257,5 @@ window.build_dialog = function(selector, content) { $("body").append("
\n" + content + "
"); $("#" + selector).modal(); } + + diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 762ff6ac..6e6379cb 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -31,7 +31,11 @@ %br %br = f.input :description, :input_html => {:rows => 5, :class=> "span11"}, :hint => "This will only be shown to organizers, not to attendees." - = f.input :video_id, :as => :string, :hint => "Go to your youtube video, click on \"share\" and copy everything behind http://youtu.be/" + = f.input :video_type, :as => :select, :label => "Media Type", :collection => [['YoubTube', 'youtube'], ['SlideShare', 'slideshare']], :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 + = f.input :video_id, :label => "Media ID", :as => :string + %section#information = f.inputs :name => "Your Information" do = semantic_fields_for @person do |p| diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 9e0bc20d..2d91454f 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -31,7 +31,10 @@ .row-fluid .span12.flexvideo -if @event.video_id - %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 == "youtube" + %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 == "slideshare" + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.slideshare.net/slideshow/embed_code/#{@event.video_id}"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} .row-fluid From 03ba8d50f4fa4459695a1d10cd1b01e985ab4b4f Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sat, 15 Mar 2014 21:48:47 +0100 Subject: [PATCH 3/8] Implements more embed codes for events - refactor video_type collection to event model enumeration #26 --- app/assets/javascripts/osem.js | 2 +- app/models/event.rb | 4 ++++ app/views/proposal/_proposal_form.html.haml | 6 +++--- app/views/proposal/show.html.haml | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index 989b00db..19700d67 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -1,7 +1,7 @@ $(function() { $("#event_video_type").change(function () { $(".media-type").hide(); - $('#' + $(this).val() + '-help').show(); + $('#' + $(this).val().toLowerCase() + '-help').show(); }); $('.dropdown-toggle').dropdown(); diff --git a/app/models/event.rb b/app/models/event.rb index 9abc4521..48db7b98 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -3,6 +3,10 @@ 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'] + + validates :video_type, inclusion: {in: VIDEO_TYPE} + acts_as_commentable has_many :event_people, :dependent => :destroy diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 6e6379cb..bbfcf713 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -31,9 +31,9 @@ %br %br = f.input :description, :input_html => {:rows => 5, :class=> "span11"}, :hint => "This will only be shown to organizers, not to attendees." - = f.input :video_type, :as => :select, :label => "Media Type", :collection => [['YoubTube', 'youtube'], ['SlideShare', 'slideshare']], :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 + = 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 = 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 2d91454f..cc3f9d4f 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -31,9 +31,9 @@ .row-fluid .span12.flexvideo -if @event.video_id - -if @event.video_type == "youtube" + -if @event.video_type == Event::YOUTUBE %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 == "slideshare" + -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}"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} From 3f863011cc56b59abc297ebb5ce27fe87849b52e Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sat, 15 Mar 2014 22:14:50 +0100 Subject: [PATCH 4/8] Implements flickr embedded for events #26 --- app/models/event.rb | 2 +- app/views/proposal/_proposal_form.html.haml | 1 + app/views/proposal/show.html.haml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) 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 From 0bbace4667843fe1944be7615c26fab945ad12c5 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sun, 16 Mar 2014 11:45:53 +0100 Subject: [PATCH 5/8] Add else statement in show view to enable backward compatibility #26 --- app/views/proposal/show.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 1cbb64ac..44970749 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -31,12 +31,12 @@ .row-fluid .span12.flexvideo -if @event.video_id - -if @event.video_type == Event::YOUTUBE - %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 + -elsif @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/#{@event.video_id}?rel=0"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} .row-fluid From c0af0a28978230ac6579f288924fe77406014276 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sun, 16 Mar 2014 12:05:44 +0100 Subject: [PATCH 6/8] Add vimeo video support for events #26 --- app/models/event.rb | 2 +- app/views/proposal/_proposal_form.html.haml | 1 + app/views/proposal/show.html.haml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/event.rb b/app/models/event.rb index daa8a39f..761a53df 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', FLICKR = "Flickr"] + VIDEO_TYPE = [YOUTUBE = 'YouTube', SLIDE_SHARE = 'SlideShare', FLICKR = "Flickr", VIMEO = "Vimeo"] 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 0186e217..a36920f3 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -35,6 +35,7 @@ %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/ + %p{:class => "help-block media-type", :id => "vimeo-help", :style => "display:none"} Go to your vimeo video, click on "share" and copy everything behind http://vimeo.com/ = 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 44970749..c959ef2d 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.slideshare.net/slideshow/embed_code/#{@event.video_id}"} -elsif @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"} + -elsif @event.video_type == Event::VIMEO + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//player.vimeo.com/video/#{@event.video_id}"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -else From 8421884c06ccb9ebe0059872fad28d3a36d2f64a Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sun, 16 Mar 2014 13:02:30 +0100 Subject: [PATCH 7/8] Add Speakerdeck video support for events #26 --- app/models/event.rb | 2 +- app/views/proposal/_proposal_form.html.haml | 1 + app/views/proposal/show.html.haml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/event.rb b/app/models/event.rb index 761a53df..6443feed 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', FLICKR = "Flickr", VIMEO = "Vimeo"] + VIDEO_TYPE = [YOUTUBE = 'YouTube', SLIDE_SHARE = 'SlideShare', FLICKR = 'Flickr', VIMEO = 'Vimeo', SPEAKERDECK = 'Speakerdeck'] 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 a36920f3..573b690b 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -36,6 +36,7 @@ %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/ %p{:class => "help-block media-type", :id => "vimeo-help", :style => "display:none"} Go to your vimeo video, click on "share" and copy everything behind http://vimeo.com/ + %p{:class => "help-block media-type", :id => "speakerdeck-help", :style => "display:none"} Go to your SpeakerDeck, click on "share" -> "embded" and copy the data-id = 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 c959ef2d..6ae26b33 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -37,6 +37,8 @@ %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "flic.kr/p/#{@event.video_id}/player/268a054da2"} -elsif @event.video_type == Event::VIMEO %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//player.vimeo.com/video/#{@event.video_id}"} + -elsif @event.video_type == Event::SPEAKERDECK + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//speakerdeck.com/player/#{@event.video_id}?"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -else From c5ba8598f52b16584e0f6cde8310568652f3daa2 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Sun, 16 Mar 2014 15:03:28 +0100 Subject: [PATCH 8/8] Add Instagram support for events #26 --- app/models/event.rb | 2 +- app/views/proposal/_proposal_form.html.haml | 3 ++- app/views/proposal/show.html.haml | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 6443feed..8fa7babe 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', FLICKR = 'Flickr', VIMEO = 'Vimeo', SPEAKERDECK = 'Speakerdeck'] + VIDEO_TYPE = [YOUTUBE = 'YouTube', SLIDE_SHARE = 'SlideShare', FLICKR = 'Flickr', VIMEO = 'Vimeo', SPEAKERDECK = 'Speakerdeck', INSTAGRAM = 'Instagram'] 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 573b690b..285c3b7f 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -36,7 +36,8 @@ %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/ %p{:class => "help-block media-type", :id => "vimeo-help", :style => "display:none"} Go to your vimeo video, click on "share" and copy everything behind http://vimeo.com/ - %p{:class => "help-block media-type", :id => "speakerdeck-help", :style => "display:none"} Go to your SpeakerDeck, click on "share" -> "embded" and copy the data-id + %p{:class => "help-block media-type", :id => "speakerdeck-help", :style => "display:none"} Go to your SpeakerDeck, click on "share" -> "embed" and copy the data-id + %p{:class => "help-block media-type", :id => "instagram-help", :style => "display:none"} Go to your Instagram photo page and copy everything behind instagram.com/p/ (without trailing /# hash symbol) = 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 6ae26b33..91b1ede0 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -39,6 +39,8 @@ %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//player.vimeo.com/video/#{@event.video_id}"} -elsif @event.video_type == Event::SPEAKERDECK %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//speakerdeck.com/player/#{@event.video_id}?"} + -elsif @event.video_type == Event::INSTAGRAM + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :scrolling =>"no", :allowtransparency=>"true", :src=> "//instagram.com/p/#{@event.video_id}/embed/"} -else %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -else