1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<%= render "shared/page_actions",
:title => t(".title"),
:icon_name => "photo-plus",
:label => t(".create_asset"),
:options => [[t(".create_asset"), new_asset_path]] %>
<%= render "shared/search_form", :placeholder => t(".search_placeholder") %>
<%= will_paginate @assets %>
<table class="admin_table assets_table">
<thead>
<tr class="header">
<th><%= t("admin.columns.preview") %></th>
<th><%= t("admin.columns.name") %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @assets.each do |asset| %>
<tr>
<td class="asset_thumb">
<% if asset.has_variant?(:thumb) %>
<%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset,
:class => "asset_thumb_link" %>
<% end %>
</td>
<td>
<div class="row_primary asset_name">
<%= link_to asset.name.presence || asset.upload_file_name, asset %>
</div>
<div class="row_secondary asset_meta asset_file">
<%= icon("external-link", library: "tabler", "aria-hidden": true) %>
<%= link_to asset.upload_file_name, asset.upload.url,
:target => "_blank", :rel => "noopener" %>
</div>
<div class="row_secondary asset_meta asset_type">
<%= asset.upload.content_type %> ·
<%= number_to_human_size(asset.upload.size) %>
</div>
</td>
<td class="actions">
<div class="action_grid">
<span class="action_item">
<%= link_to asset, "aria-label" => t("admin.common.show"),
title: t("admin.common.show") do %>
<%= icon("eye", library: "tabler", "aria-hidden": true) %>
<% end %>
</span>
<span class="action_item">
<%= link_to edit_asset_path(asset), "aria-label" => t("admin.common.edit"),
title: t("admin.common.edit") do %>
<%= icon("edit", library: "tabler", "aria-hidden": true) %>
<% end %>
</span>
<span class="action_item">
<%= button_to asset, method: :delete,
form: { data: { confirm: t("admin.common.confirm_sure") },
class: 'button_to destructive' },
"aria-label" => t("admin.common.destroy"),
title: t("admin.common.destroy") do %>
<%= icon("trash", library: "tabler", "aria-hidden": true) %>
<% end %>
</span>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
|