scinote-web/app/views/steps/attachments/_item.html.erb
Alex Kriuchykhin db7c6435b3
Merge pull request #1851 from okriuchykhin/ok_SCI_3436
Implement saving of attachments ordering on steps [SCI-3436]
2019-06-20 11:31:15 +02:00

27 lines
1 KiB
Text

<% 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 %>
<div class="pseudo-attachment-container" style="order: <%= assets_count - i %>">
<%= 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 %>
<%= render partial: 'steps/attachments/placeholder.html.erb',
locals: { edit_page: false, asset: asset } %>
<% end %>
</div>