Sha256: 04fa6ef3c4add47365ad1cc2ac9bd355036e4fbb58cc53844ab5c1b972a700ac

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 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
%>
<style>
  <%# figure out a way to remove this %>
   td img {
       max-height: unset !important;
   }
</style>
<%
  attachments = Array(field.many? ? field.attachments : field.data)
%>
<% if field.attached? %>
  <% if field.show_in_index? %>
    <%= render partial: 'fields/active_storage/item', 
              locals: { 
                field: field, 
                attachment: field.data, 
                image_size: [50, 50] 
              } %>
  <% end %>
  <% if field.index_display_count? %>
    <div class="attachments-count">
      <%= pluralize(field.attachments.count, 'Attachment') %>
    </div>
  <% end %>
<% else %>
  0 Attached files
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
viniBaxter-field-active_storage-11.0.1 app/views/fields/active_storage/_index.html.erb
viniBaxter-field-active_storage-11.0.0 app/views/fields/active_storage/_index.html.erb
viniBaxter-field-active_storage-10.0.0 app/views/fields/active_storage/_index.html.erb