Sha256: 393e210a5d7cbcfba9f6965c5ce4fd4a5a967c3b1ceabd43fafe9387dc1309eb

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 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)) %>
      <% elsif variant == false %>
        <%= image_tag(field.url(attachment)) %>
      <% 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

4 entries across 4 versions & 1 rubygems

Version Path
administrate-field-active_storage-1.0.5 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-1.0.4 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-1.0.2 app/views/fields/active_storage/_preview.html.erb
administrate-field-active_storage-1.0.1 app/views/fields/active_storage/_preview.html.erb