Sha256: c5796099c9d771f1d52cfc473bc8cc303083f9227a120447357aa985690847dd

Contents?: true

Size: 890 Bytes

Versions: 43

Compression:

Stored size: 890 Bytes

Contents

<% image_zoomable = true if image_zoomable.nil? # do not use ||= as image_zoomable may be "false" %>
<% fullsize_url = url_for(blob) %>
<%  image_width = blob.metadata.has_key?(:width) ? blob.metadata[:width] : ActiveStorage::Analyzer::ImageAnalyzer.new(blob).metadata[:width] %>

<% if image_zoomable %>
  <a data-fancybox title="<%= strip_tags(caption) %>" href="<%= fullsize_url %>">
<% end %>
    <img src="<%= fullsize_url %>"
        srcset="
          <% [1920, 1600, 1440, 1366, 1280, 1024, 800, 768, 640, 360, 200].each do |size| %>
            <% next if size > image_width %>
            <%= url_for(blob.variant(resize: "#{size}>", quality: 95)) %> <%= size %>w,
          <% end %>
        "
        width="<%= image_width %>"
        sizes="100vw"
        alt="<%= alt.html_safe %>"
        class="img-fluid img-responsive"
        >

<% if image_zoomable %>
  </a>
<% end %>

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
promethee-4.1.6 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.5 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.4 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.3 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.2 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.1 app/views/promethee/show/_image.srcset.html.erb
promethee-4.1.0 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.8 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.7 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.6 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.5 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.4 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.3 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.2 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.1 app/views/promethee/show/_image.srcset.html.erb
promethee-4.0.0 app/views/promethee/show/_image.srcset.html.erb
promethee-3.0.2 app/views/promethee/show/_image.srcset.html.erb
promethee-3.0.1 app/views/promethee/show/_image.srcset.html.erb
promethee-3.0.0 app/views/promethee/show/_image.srcset.html.erb
promethee-2.1.3 app/views/promethee/show/_image.srcset.html.erb