scinote-web/app/views/steps/attachments/_placeholder.html.erb

28 lines
1.1 KiB
Text
Raw Normal View History

<% image_preview = (asset.is_image? || asset.file.previewable_document?) ? asset.url(:medium) : nil %>
2019-04-09 18:28:42 +08:00
<div class="attachment-placeholder pull-left">
<div class="attachment-thumbnail <%= image_preview ? '' : 'no-shadow' %>">
<% if image_preview %>
<%= image_tag image_preview %>
<% else %>
2019-04-26 14:58:01 +08:00
<i class="fas <%= file_fa_icon_class(asset) if asset.file_file_name %>"></i>
2019-04-09 18:28:42 +08:00
<% end %>
</div>
<div class="attachment-label"><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></div>
<div class="spencer-bonnet-modif">
2019-04-23 19:35:10 +08:00
<%= t('protocols.steps.attachments.modified_label') %> <%= l(asset.updated_at, format: :full_date) if asset.updated_at %> <br>
2019-04-09 18:28:42 +08:00
<%= number_to_human_size(asset.file.size) %>
2016-02-12 23:52:43 +08:00
</div>
2019-04-23 19:35:10 +08:00
<% 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 %>
2019-04-09 18:28:42 +08:00
<% end %>
2019-04-23 19:35:10 +08:00
</div>
<% end %>
2016-10-02 00:47:05 +08:00
</div>