2019-04-09 18:28:42 +08:00
|
|
|
<div class="attachment-placeholder pull-left">
|
2019-08-13 17:04:19 +08:00
|
|
|
|
|
|
|
<div class="attachment-thumbnail <%= asset.previewable? ? '' : 'no-shadow' %> <%= asset.file.attached? ? asset.file.metadata['asset_type'] : '' %>">
|
2019-06-28 14:17:09 +08:00
|
|
|
<% if asset.previewable? %>
|
2019-09-24 03:07:03 +08:00
|
|
|
<%= image_tag asset.medium_preview,
|
|
|
|
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
|
|
|
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
|
|
style: 'opacity: 0' %>
|
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">
|
2019-08-13 17:04:19 +08:00
|
|
|
<% if asset.file.attached? && asset&.file&.metadata['asset_type'] %>
|
|
|
|
<%= truncate(asset.file.metadata['name'], length: Constants::FILENAME_TRUNCATION_LENGTH) %>
|
|
|
|
<% else %>
|
|
|
|
<%= truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
|
|
|
|
<% end %>
|
2019-06-28 14:17:09 +08:00
|
|
|
</div>
|
2019-04-09 18:28:42 +08:00
|
|
|
<div class="spencer-bonnet-modif">
|
2019-07-10 20:37:23 +08:00
|
|
|
<%= 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>
|
2019-07-04 15:33:12 +08:00
|
|
|
<% end %>
|
2016-10-02 00:47:05 +08:00
|
|
|
</div>
|