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

28 lines
1 KiB
Text
Raw Normal View History

<% if asset.file.processing? && (asset.is_image? || asset.file.previewable_document?) %>
<% asset_status = 'asset-loading' %>
<% present_url = file_present_asset_path(asset.id) %>
<% else %>
<% asset_status = 'asset-present' %>
<% present_url = '' %>
<% end %>
2019-05-06 15:56:26 +08:00
<div class="pseudo-attachment-container" style="order: <%= assets_count - i %>">
2019-04-26 21:20:39 +08:00
<%= link_to download_asset_path(asset),
class: 'file-preview-link',
id: "modal_link#{asset.id}",
data: { no_turbolink: true,
id: true,
status: asset_status,
'present-url': present_url,
'preview-url': asset_file_preview_path(asset),
'order-atoz': order_atoz,
'order-ztoa': order_ztoa,
'order-old': i,
'order-new': assets_count - i,
} do %>
2019-04-26 21:20:39 +08:00
<%= render partial: 'steps/attachments/placeholder.html.erb',
2019-04-23 19:35:10 +08:00
locals: { edit_page: false, asset: asset } %>
2019-04-26 21:20:39 +08:00
<% end %>
</div>