Sha256: b0e156f644482063ef90c2b11fe4161ed42f56c0a8863ac6cd82286090766cb8

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

<div class="as-field as-field-<%= action_name %>">
  <% if attachment.image? %>
    <% if attachment.variable? %>
      <% if variant.nil? %>
        <%= image_tag(field.variant(attachment, resize_to_limit: size)) %>
      <% else %>
        <%= image_tag(attachment.variant(variant)) %>
      <% end %>
    <% 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,
                    class: "as-field-video") %>
    <% else %>
      <%= video_tag(field.url(attachment), controls: true, autobuffer: true, class: "as-field-video") %>
    <% 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

3 entries across 3 versions & 1 rubygems

Version Path
administrate-field-active_storage-1.0.0 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-0.4.2 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-0.4.1 app/views/fields/active_storage/_preview.html.erb