Sha256: b6ead78de427723c4a07b203c7d9a1fa4a5400d186e602c45f1f36a5fdbb9ca9

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

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,
                    I18n.t("administrate.fields.active_storage.attachment", default: 'Attachment')
          )
      %>
    </div>
  <% end %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

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