scinote-web/app/views/assets/_asset_list.html.erb

36 lines
1.3 KiB
Text
Raw Normal View History

2020-10-16 17:00:57 +08:00
<div class="list-attachment-container asset"
data-asset-id="<%= asset.id %>"
data-asset-file-name="<%= asset.file_name %>"
data-asset-updated-at="<%= asset.updated_at.to_i %>"
data-asset-order="1"
>
<div class="file-icon">
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
</div>
<%= link_to rails_blob_path(asset.file, disposition: 'attachment'),
class: "file-preview-link file-name",
id: "modal_link#{asset.id}",
data: { no_turbolink: true, id: true, 'preview-url': asset_file_preview_path(asset)} do %>
<%= asset.file_name %>
<% end %>
<div class="file-metadata">
<span><%= t('assets.placeholder.modified_label') %> <%= l(asset.updated_at, format: :full_date) if asset.updated_at %></span>
<span><%= number_to_human_size(asset.file_size) %></span>
</div>
<div class="change-preview-type"
data-preview-type="inline"
data-toggle-view-url="<%= toggle_view_mode_path(asset) %>">
<i class="fas fa-desktop"></i>
</div>
<div class="change-preview-type"
data-preview-type="list"
data-toggle-view-url="<%= toggle_view_mode_path(asset) %>">
<i class="fas fa-list"></i>
</div>
<div class="change-preview-type"
data-preview-type="thumbnail"
data-toggle-view-url="<%= toggle_view_mode_path(asset) %>">
<i class="fas fa-th-large"></i>
</div>
</div>