summaryrefslogtreecommitdiff
path: root/app/views/assets/index.html.erb
blob: 81d2686a6bc85d59bcbf74dd54e2d601587b32d9 (plain)
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
<h1><%= t(".title") %></h1>

<%= link_to new_asset_path, class: 'action_button' do %>
  <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_asset") %>
<% end %>

<%= will_paginate @assets %>

<table class="assets_table">
  <tr class="header">
    <th><%= t("admin.columns.preview") %></th>
    <th><%= t("admin.columns.name") %></th>
    <th><%= t("admin.columns.type") %></th>
    <th></th>
    <th></th>
    <th></th>
  </tr>
<% @assets.each do |asset| %>
  <tr>
    <td><% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %></td>
    <td><%= link_to asset.name, asset.upload.url %></td>
    <td><%= asset.upload.content_type %></td>
    <td><%= link_to t("admin.common.show"), asset %></td>
    <td><%= link_to t("admin.common.edit"), edit_asset_path(asset) %></td>
    <td><%= button_to asset, method: :delete, form: { data: { confirm: t("admin.common.confirm_sure") }, class: 'button_to destructive' } do %>
      <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %>
    <% end %></td>
  </tr>
<% end %>
</table>