Files
fizzy/app/views/events/event/attachments/_attachment.html.erb
T
Jorge Manrubia bc915c4b05 Extract partials
2025-11-03 07:29:00 +01:00

14 lines
686 B
Plaintext

<% variant = Attachments::VARIANTS[:small] %>
<% width = attachment.metadata["width"] %>
<% height = attachment.metadata["height"] %>
<% if attachment.previewable? %>
<%= image_tag url_for(attachment.preview(variant)), class: "attachment attachment--image", width: width, height: height %>
<% elsif attachment.variable? %>
<%= image_tag url_for(attachment.variant(variant)), class: "attachment attachment--image", width: width, height: height %>
<% else %>
<div class="attachment attachment--file attachment--<%= attachment.filename.extension -%>">
<span class="attachment__icon"><%= attachment.filename.extension&.downcase.presence || "unknown" %></span>
</div>
<% end %>