Sha256: 3ccc7a7ce0ec4f802cf7d98152bd9d56192c82f9e122c07b8884da84be38a747
Contents?: true
Size: 1.12 KB
Versions: 5
Compression:
Stored size: 1.12 KB
Contents
<% caption = component[:attributes].dig(:caption, :value)&.to_s&.html_safe media_type = component[:attributes].dig(:media_type, :value)&.to_s case media_type when 'image' image_blob = blob_from_data component[:attributes][:image][:value] when 'video' url = component[:attributes][:video][:value].to_s if 'vimeo'.in? url video_id = url.gsub(/\A(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?\z/, '\1') iframe_src = "https://player.vimeo.com/video/#{video_id}?color=ffffff&title=0&byline=0&portrait=0" elsif 'youtube'.in? url video_id = url.split('watch?v=').last iframe_src = "http://www.youtube.com/embed/#{video_id}" else iframe_src = url end end %> <div class="collection-item__content"> <% if iframe_src.present? %> <div class="embed-responsive embed-responsive-16by9"> <iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe> </div> <% elsif image_blob.present? %> <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption %> <% end %> <%= caption %> </div>
Version data entries
5 entries across 5 versions & 1 rubygems