Sha256: 293fd3692fa15b54530ce5f2f8677533733bbfd949f1b01c8868457251028932

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

<%#
# Image Index Partial

This partial renders an image attribute
to be displayed on a resource's index page.

By default, the attribute is rendered as an image tag.

## Local variables:

- `field`:
  An instance of [Administrate::Field::Image][1].
  A wrapper around the image url pulled from the database.

[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image
%>

<% if field.attached? %>
  <style> <%# figure out a way to remove this %>
  td img {
    max-height: unset !important;
  }
  </style>
  <% if field.index_display_preview? %>
    <%= render partial: 'fields/active_storage/preview',
               locals: {
                   field: field,
                   attachment: field.data,
                   size: field.index_preview_size
               } %>
  <% end %>

  <% if field.index_display_count? %>
    <div class="attachments-count">
      <%= pluralize(field.attachments.count, 'Attachment') %>
    </div>
  <% end %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.3.6 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.3.5 app/views/fields/active_storage/_index.html.erb