Sha256: 16e6bb42bff0ef0dd8f2db9c0c206c46d2a89f25fc5f941719efd4cf7fff7b43
Contents?: true
Size: 1.2 KB
Versions: 97
Compression:
Stored size: 1.2 KB
Contents
<% media_type = component[:attributes][:media_type] searchable_caption = component[:attributes][:searchable_caption] case media_type when 'image' image_data = component[:attributes][:image] if image_data && image_data[:id] image_blob = ActiveStorage::Blob.find image_data[:id] end when 'video' url = component[:attributes][:video][:url].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="carousel-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: searchable_caption %> <% end %> <%= searchable_caption.to_s.html_safe %> </div>
Version data entries
97 entries across 97 versions & 1 rubygems