mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 20:24:43 +08:00
27 lines
1.1 KiB
Text
27 lines
1.1 KiB
Text
<% image_preview = (asset.is_image? || asset.file.previewable_document?) ? asset.url(:medium) : nil %>
|
|
|
|
<div class="attachment-placeholder pull-left">
|
|
<div class="attachment-thumbnail <%= image_preview ? '' : 'no-shadow' %>">
|
|
<% if image_preview %>
|
|
<%= image_tag image_preview %>
|
|
<% else %>
|
|
<i class="fas <%= file_fa_icon_class(asset) if asset.file_file_name %>"></i>
|
|
<% end %>
|
|
</div>
|
|
<div class="attachment-label"><%= truncate(asset.file_file_name,
|
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %></div>
|
|
<div class="spencer-bonnet-modif">
|
|
<%= t('protocols.steps.attachments.modified_label') %> <%= l(asset.updated_at, format: :full_date) if asset.updated_at %> <br>
|
|
<%= number_to_human_size(asset.file.size) %>
|
|
</div>
|
|
|
|
<% if edit_page %>
|
|
<div class="remove-icon pull-right">
|
|
<% unless ff.object.file.exists? && ff.object.locked? %>
|
|
<%= ff.remove_nested_fields_link do %>
|
|
<span class="fas fa-trash"></span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|