idn_app/app/views/portlets/render_public/_videocontent.html.haml
Nicolas Bally b5690bc6f2 initial
2016-07-25 15:55:11 +02:00

28 lines
1.3 KiB
Plaintext

-if input.video_file
-video_file = input.video_file
-if input.video_file.image_file
-img_url = input.video_file.image_file.file.large.url
-else
-img_url = ""
-css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;"
-if video_file and video_file.youtube_code?
-facebook_link = link_to "https://www.facebook.com/sharer/sharer.php?u=#{public_video_file_url(:slug => video_file.slug)}", :target => "_blank", :class => "link facebook", :onclick => "event.stopPropagation();" do
=i(:"facebook")
=#text=CSS%20Social%20Media%20Sidebar&
-twitter_link = link_to "https://twitter.com/intent/tweet?url=#{public_video_file_url(:slug => video_file.slug)}&via=onevoiceplanet", :target => "_blank", :class => "link twitter", :onclick => "event.stopPropagation();" do
=i(:"twitter")
.video_expand.menu_itemlink_content{:style => css_style, :data => {:video_title => video_file.title, :facebook_link => facebook_link, :twitter_link => twitter_link, :ratio => "0.62", :video_url => 'https://www.youtube.com/embed/'+video_file.youtube_code+'?autoplay=1&rel=0'}}
.overlay
.gradient
%h4.title
=ic(:play)
= video_file.title if video_file.title?