5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 13:46:22 +00:00
panel/app/views/active_storage/blobs/_blob.html.erb
2020-10-03 21:46:24 -03:00

14 lines
600 B
Text

<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
<% if blob.representable? %>
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
<% end %>
<figcaption class="attachment__caption">
<% if caption = blob&.caption %>
<%= caption %>
<% else %>
<span class="attachment__name"><%= blob.filename %></span>
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
<% end %>
</figcaption>
</figure>