scinote-web/app/views/shared/_asset_placeholder.html.erb

27 lines
949 B
Text
Raw Normal View History

2019-04-09 18:28:42 +08:00
<div class="attachment-placeholder pull-left">
2019-06-28 14:17:09 +08:00
<div class="attachment-thumbnail <%= asset.previewable? ? '' : 'no-shadow' %>">
<% if asset.previewable? %>
<%= image_tag asset.medium_preview %>
2019-04-09 18:28:42 +08:00
<% else %>
2019-06-28 14:17:09 +08:00
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
2019-04-09 18:28:42 +08:00
<% end %>
</div>
2019-06-28 14:17:09 +08:00
<div class="attachment-label">
<%= truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
</div>
2019-04-09 18:28:42 +08:00
<div class="spencer-bonnet-modif">
<%= t('assets.placeholder.modified_label') %> <%= l(asset.updated_at, format: :full_date) if asset.updated_at %> <br>
2019-06-28 14:17:09 +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">
2019-06-28 14:17:09 +08:00
<% unless ff.object.file.attached? && ff.object.locked? %>
2019-04-23 19:35:10 +08:00
<%= 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>