Sha256: fba0e69147d18ea18cfda9ab5113effcce198f5142e9e3134e1a2c0d525ce1e8

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

<div style="width: <%=size[0]%>px; height: auto; overflow: hidden;">
  <% if attachment.image? %>
    <% if attachment.variable? %>
      <%= image_tag(field.variant(attachment, resize_to_limit: size)) %>
    <% else %>
      <%= image_tag(field.url(attachment)) %>
    <% end %>
  <% elsif attachment.video? %>
    <% if attachment.previewable? %>
      <%= video_tag(field.url(attachment),
                    poster: field.preview(attachment, resize_to_limit: size),
                    controls: true,
                    autobuffer: true,
                    style: "object-fit: contain; width: 100%; height: 100%;") %>
    <% else %>
      <%= video_tag(field.url(attachment), controls: true, autobuffer: true, style: "object-fit: contain; width: 100%; height: 100%;") %>
    <% end %>
  <% elsif attachment.audio? %>
    <%= audio_tag(field.url(attachment), autoplay: false, controls: true) %>
  <% elsif attachment.previewable? %>
    <%= image_tag(field.preview(attachment, resize_to_limit: size)) %>
  <% else %>
    <%= attachment.filename %>
  <% end %>
</div>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.3.7 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-0.3.6 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-0.3.5 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-0.3.4 app/views/fields/active_storage/_preview.html.erb