From 74535b4bd8397fd5be938f05293ae3f1e881424b Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Fri, 27 Jun 2014 22:51:33 +0530 Subject: [PATCH] Adds instagram fontawesome icon to splash and reverting the description for slideshare & speakerdeck to have media ids instead of link Adds test for instagram url to conference show --- app/views/admin/conference/edit.html.haml | 4 +-- app/views/conference/_social_media.html.haml | 26 +++++--------------- spec/views/conference/show.html.haml_spec.rb | 7 +++--- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/app/views/admin/conference/edit.html.haml b/app/views/admin/conference/edit.html.haml index 7a57ce82..c2725053 100644 --- a/app/views/admin/conference/edit.html.haml +++ b/app/views/admin/conference/edit.html.haml @@ -38,10 +38,10 @@ = f.input :media_type, :as => :select, :label => "Conference Promo Media Type", :class=>"form-control", :collection => Conference.media_types.values, :include_blank => false, :hint => "This media-item will be used to represent this conference at various places in OSEM." = f.input :media_id, :label => "Conference Promo Media ID", :as => :string %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" -> "link" and copy the link + %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 flickr 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" -> "link" and copy the link + %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 :facebook_url, hint: 'This will appear in the social media section as link to the Facebook page of your Conference' = f.input :google_url, label: 'Google+ Url', hint: 'This will appear in the social media section as the link to the Google+ Page of your Conference' diff --git a/app/views/conference/_social_media.html.haml b/app/views/conference/_social_media.html.haml index af091888..2edcd09c 100644 --- a/app/views/conference/_social_media.html.haml +++ b/app/views/conference/_social_media.html.haml @@ -4,33 +4,19 @@ %div.container#social-media.text-center %div.row - - if !@conference.facebook_url.blank? + - unless @conference.facebook_url.blank? %div.col-md-3 = link_to "#{ @conference.facebook_url }" do %i.fa.fa-facebook-square.fa-4x - - if !@conference.twitter_url.blank? + - unless @conference.twitter_url.blank? %div.col-md-3 = link_to "#{ @conference.twitter_url }" do %i.fa.fa-twitter.fa-4x - - if !@conference.media_type.blank? && !@conference.media_id.blank? + - unless @conference.instagram_url.blank? %div.col-md-3 - -if @conference.media_type == 'YouTube' - = link_to "http://youtu.be/#{ @conference.media_id}" do - %i.fa.fa-youtube.fa-4x - -if @conference.media_type == 'SlideShare' - = link_to image_tag('slideshare.png', class: 'img-responsive'), "#{ @conference.media_id}" - -if @conference.media_type == 'Instagram' - = link_to "http://instagram.com/p/#{ @conference.media_id}" do - %i.fa.fa-instagram.fa-4x - -if @conference.media_type == 'Vimeo' - = link_to "http://vimeo.com/#{ @conference.media_id}" do - %i.fa.fa-vimeo-square.fa-4x - -if @conference.media_type == 'Speakerdeck' - = link_to image_tag('speakerdeck.png', class: 'img-responsive'),"#{ @conference.media_id}" - -if @conference.media_type == 'Flickr' - = link_to "https://flic.kr/p/#{ @conference.media_id}" do - %i.fa.fa-flickr.fa-4x - - if !@conference.google_url.blank? + = link_to "#{ @conference.instagram_url }" do + %i.fa.fa-instagram.fa-4x + - unless @conference.google_url.blank? %div.col-md-3 = link_to "#{ @conference.google_url }" do %i.fa.fa-google-plus-square.fa-4x diff --git a/spec/views/conference/show.html.haml_spec.rb b/spec/views/conference/show.html.haml_spec.rb index 9ea5e023..fb809d84 100644 --- a/spec/views/conference/show.html.haml_spec.rb +++ b/spec/views/conference/show.html.haml_spec.rb @@ -9,8 +9,8 @@ describe 'conference/show.html.haml' do sponsor_email: 'example@example.com', facebook_url: 'http://www.fbexample.com', google_url: 'http://www.google-example.com', - media_type: 'YouTube', - media_id: 'rtyutut', + instagram_url: "http://instagram.com", + twitter_url: "http://twitter.com", include_registrations_in_splash: true, include_program_in_splash: true, include_sponsors_in_splash: true, @@ -64,7 +64,8 @@ describe 'conference/show.html.haml' do expect(view).to render_template('conference/_social_media') expect(view.content_for(:splash)).to include('http://www.fbexample.com') expect(view.content_for(:splash)).to include('http://www.google-example.com') - expect(view.content_for(:splash)).to include('http://youtu.be/rtyutut') + expect(view.content_for(:splash)).to include("http://instagram.com") + expect(view.content_for(:splash)).to include("http://twitter.com") end it 'renders location partial' do