Adds social media to splash
BIN
app/assets/images/fb-logo-blue.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/assets/images/flickr.png
Normal file
|
After Width: | Height: | Size: 938 B |
BIN
app/assets/images/google-logo.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
app/assets/images/instagram.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/assets/images/slideshare.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
app/assets/images/speakerdeck.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/assets/images/twitter-logo-blue.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/assets/images/vimeo-logo-dark.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/assets/images/youtube-color-logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
35
app/views/conference/_social_media.html.haml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
= content_for :splash_nav do
|
||||
%li
|
||||
%a{ href: '#social-media' } Social Media
|
||||
|
||||
%div.container#social-media.text-center
|
||||
%div.row
|
||||
- if !@conference.facebook_url.blank?
|
||||
%div.col-md-3
|
||||
= link_to image_tag('fb-logo-blue.png', class: 'img-responsive'),
|
||||
"#{ @conference.facebook_url }"
|
||||
- if !@conference.twitter_url.blank?
|
||||
%div.col-md-3
|
||||
= link_to image_tag('twitter-logo-blue.png', class: 'img-responsive'), "#{ @conference.twitter_url }"
|
||||
- if !@conference.media_type.blank? && !@conference.media_id.blank?
|
||||
%div.col-md-3
|
||||
-if @conference.media_type == 'YouTube'
|
||||
= link_to image_tag('youtube-color-logo.png', class: 'img-responsive'),
|
||||
"http://youtu.be/#{ @conference.media_id}"
|
||||
-if @conference.media_type == 'SlideShare'
|
||||
= link_to image_tag('slideshare.png', class: 'img-responsive'), "#{ @conference.media_id}"
|
||||
-if @conference.media_type == 'Instagram'
|
||||
= link_to image_tag('instagram.png', class: 'img-responsive'),
|
||||
"http://instagram.com/p/#{ @conference.media_id}"
|
||||
-if @conference.media_type == 'Vimeo'
|
||||
= link_to image_tag('vimeo-logo-dark.png', class: 'img-responsive'),
|
||||
"http://vimeo.com/#{ @conference.media_id}"
|
||||
-if @conference.media_type == 'Speakerdeck'
|
||||
= link_to image_tag('speakerdeck.png', class: 'img-responsive'),"#{ @conference.media_id}"
|
||||
-if @conference.media_type == 'Flickr'
|
||||
= link_to image_tag('flickr.png', class: 'img-responsive'),
|
||||
"https://flic.kr/p/#{ @conference.media_id}"
|
||||
- if !@conference.google_url.blank?
|
||||
%div.col-md-3
|
||||
= link_to image_tag('google-logo.png', class: 'img-responsive'),
|
||||
"#{ @conference.google_url }"
|
||||
|
|
@ -9,4 +9,5 @@
|
|||
= render 'call_for_papers'
|
||||
%div#sponsors
|
||||
= render 'sponsor'
|
||||
|
||||
%div#social-media
|
||||
= render 'social_media'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ describe 'conference/show.html.haml' do
|
|||
registration_end_date: Date.tomorrow,
|
||||
description: 'Lorem Ipsum',
|
||||
sponsor_description: 'Lorem Ipsum Dolor',
|
||||
sponsor_email: 'example@example.com')
|
||||
sponsor_email: 'example@example.com',
|
||||
facebook_url: 'http://www.fbexample.com',
|
||||
google_url: 'http://www.google-example.com',
|
||||
media_type: 'YouTube',
|
||||
media_id: 'rtyutut')
|
||||
@conference.call_for_papers = create(:call_for_papers, conference: @conference)
|
||||
@conference.sponsorship_levels << create(:sponsorship_level, conference: @conference)
|
||||
@sponsorship_level = @conference.sponsorship_levels.first
|
||||
|
|
@ -39,5 +43,11 @@ describe 'conference/show.html.haml' do
|
|||
expect(rendered).to include('http://www.example.com')
|
||||
expect(rendered).to include('Lorem Ipsum Dolor')
|
||||
expect(rendered).to include('rails.jpg')
|
||||
|
||||
it 'renders social media partial' do
|
||||
expect(view).to render_template('conference/_social_media')
|
||||
expect(rendered).to include('http://www.fbexample.com')
|
||||
expect(rendered).to include('http://www.google-example.com')
|
||||
expect(rendered).to include('http://youtu.be/rtyutut')
|
||||
end
|
||||
end
|
||||
|
|
|
|||