summaryrefslogtreecommitdiff
path: root/app/views/assets/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/assets/index.html.erb')
-rw-r--r--app/views/assets/index.html.erb56
1 files changed, 45 insertions, 11 deletions
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb
index d2c5d6cc..84f096c2 100644
--- a/app/views/assets/index.html.erb
+++ b/app/views/assets/index.html.erb
@@ -12,21 +12,55 @@
12 <tr class="header"> 12 <tr class="header">
13 <th><%= t("admin.columns.preview") %></th> 13 <th><%= t("admin.columns.preview") %></th>
14 <th><%= t("admin.columns.name") %></th> 14 <th><%= t("admin.columns.name") %></th>
15 <th><%= t("admin.columns.type") %></th>
16 <th></th>
17 <th></th>
18 <th></th> 15 <th></th>
19 </tr> 16 </tr>
20<% @assets.each do |asset| %> 17<% @assets.each do |asset| %>
21 <tr> 18 <tr>
22 <td><% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %></td> 19 <td class="asset_thumb">
23 <td><%= link_to asset.name, asset.upload.url %></td> 20 <% if asset.has_variant?(:thumb) %>
24 <td><%= asset.upload.content_type %></td> 21 <%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset,
25 <td><%= link_to t("admin.common.show"), asset %></td> 22 :class => "asset_thumb_link" %>
26 <td><%= link_to t("admin.common.edit"), edit_asset_path(asset) %></td> 23 <% end %>
27 <td><%= button_to asset, method: :delete, form: { data: { confirm: t("admin.common.confirm_sure") }, class: 'button_to destructive' } do %> 24 </td>
28 <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> 25 <td>
29 <% end %></td> 26 <div class="asset_name">
27 <%= link_to asset.name.presence || asset.upload_file_name, asset %>
28 </div>
29 <div class="asset_meta asset_file">
30 <%= icon("external-link", library: "tabler", "aria-hidden": true) %>
31 <%= link_to asset.upload_file_name, asset.upload.url,
32 :target => "_blank", :rel => "noopener" %>
33 </div>
34 <div class="asset_meta asset_type">
35 <%= asset.upload.content_type %> ยท
36 <%= number_to_human_size(asset.upload.size) %>
37 </div>
38 </td>
39 <td class="actions">
40 <div class="action_grid">
41 <span class="action_item">
42 <%= link_to asset, "aria-label" => t("admin.common.show"),
43 title: t("admin.common.show") do %>
44 <%= icon("eye", library: "tabler", "aria-hidden": true) %>
45 <% end %>
46 </span>
47 <span class="action_item">
48 <%= link_to edit_asset_path(asset), "aria-label" => t("admin.common.edit"),
49 title: t("admin.common.edit") do %>
50 <%= icon("edit", library: "tabler", "aria-hidden": true) %>
51 <% end %>
52 </span>
53 <span class="action_item">
54 <%= button_to asset, method: :delete,
55 form: { data: { confirm: t("admin.common.confirm_sure") },
56 class: 'button_to destructive' },
57 "aria-label" => t("admin.common.destroy"),
58 title: t("admin.common.destroy") do %>
59 <%= icon("trash", library: "tabler", "aria-hidden": true) %>
60 <% end %>
61 </span>
62 </div>
63 </td>
30 </tr> 64 </tr>
31<% end %> 65<% end %>
32</table> 66</table>