mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 18:21:04 +08:00
32 lines
1.3 KiB
Text
32 lines
1.3 KiB
Text
|
<% image_preview = asset.is_image? ? asset.url(:medium) : nil %>
|
||
|
|
||
|
<%= link_to download_asset_path(asset),
|
||
|
class: 'file-preview-link',
|
||
|
id: "modal_link#{asset.id}",
|
||
|
style: "order: #{ assets_count - i }",
|
||
|
data: { no_turbolink: true, id: true, status: 'asset-present',
|
||
|
'preview-url': asset_file_preview_path(asset),
|
||
|
'order-atoz': az_ordered_assets_index(step, asset.id),
|
||
|
'order-ztoa': assets_count - az_ordered_assets_index(step, asset.id),
|
||
|
'order-old': i,
|
||
|
'order-new': assets_count - i,
|
||
|
} do %>
|
||
|
|
||
|
|
||
|
<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 fa-image"></i>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<div class="attachment-label"><%= truncate(asset.file_file_name,
|
||
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %></div>
|
||
|
<div class="spencer-bonnet-modif">
|
||
|
Modified: <%= l(asset.updated_at, format: :full_date) %> <br>
|
||
|
<%= number_to_human_size(asset.file.size) %>
|
||
|
</div>
|
||
|
</div>
|
||
|
<% end %>
|