Sha256: 853de2fa039003f2f8e750713fbfbf71a35f9850bd0cf704f93fbe283ddb3893

Contents?: true

Size: 990 Bytes

Versions: 8

Compression:

Stored size: 990 Bytes

Contents

<%#
# Item Partial

This partial renders attached items.

Attachments of type image, video and audio are emedded.  For all other types
we try use it's preview.  If all else fails we simply link to the attached file.

This partial will optionally show a `remove` link next to each attachment which is
controlled via a boolean local variable.

## Local variables:

- `field`:
  An instance of [Administrate::Field::Image].
  A wrapper around the image url pulled from the database.
- `attachment`:
  Reference to the file
- `removable`:
  A boolean used to control the display of a `Remove` link which
  is used to destroy a single attachment.  Defaults to `false`
- `size`:
  [x, y]
  Maximum size of the ActiveStorage preview.
%>
<% if field.show_display_preview? %>
  <div>
    <%= render partial: 'fields/active_storage/normal/preview', locals: local_assigns %>
  </div>
<% end %>
<div>
  <%#= link_to attachment.filename, field.blob_url(attachment), title: attachment.filename %>
</div>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
viniBaxter-field-active_storage-300.0.18 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.17 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.15 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.11 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.10 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.9 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.8 app/views/fields/active_storage/normal/_item.html.erb
viniBaxter-field-active_storage-300.0.4 app/views/fields/active_storage/normal/_item.html.erb