%# # 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` %> <% # By default we don't allow attachment removal removable = local_assigns.fetch(:removable, false) image_size = local_assigns.fetch(:image_size, [1920, 1080]) %> <% if attachment.image? and attachment.variable? and !field.url_only? %> <%#= link_to(field.blob_url(attachment), title: attachment.filename) do %> <%#= image_tag(field.variant(attachment, resize_to_limit: image_size)) %> <%#= link_to(field.blob_url(attachment), title: attachment.filename, class:'avatar avatar-sm mr-2') do %> <%#= image_tag attachment, class:"avatar-img rounded-circle" %> <%#= link_to(field.blob_url(attachment), title: attachment.filename, class:'avatar avatar-sm mr-2') do %> <%#= image_tag(field.variant(attachment, resize_to_limit: image_size, quality: 100, :loader => {strip: true, type: "TrueColorMatte"}), class:"avatar-img rounded-circle") %> <%# end %>