diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-12 01:24:28 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-12 01:24:28 +0200 |
| commit | 5f6f272b433ffb1ec0bda2a5e6d64709c4ac6f33 (patch) | |
| tree | eade981fb2d0b90797a0ae233eb4282305b6ef81 /app/views/assets | |
| parent | dd2264fb24b457910a76fac486e40c0c7a46581c (diff) | |
Give the admin lists a shared table and row vocabulary
row_primary and row_secondary replace four names for a row's title and five
for its supporting line, across the tables and the sitemap. Actions cells no
longer sit flush against the row edge
Header rows move into thead, which retires the .header class from the CSS,
the tr.header:hover suppression, and .no_hover
Replace variety of nodes_table, assets_table, events_table, revisions_table,
user_table and sitemap with a shared class admin_table
Diffstat (limited to 'app/views/assets')
| -rw-r--r-- | app/views/assets/index.html.erb | 114 |
1 files changed, 59 insertions, 55 deletions
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index 84f096c2..c71607cf 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb | |||
| @@ -8,59 +8,63 @@ | |||
| 8 | 8 | ||
| 9 | <%= will_paginate @assets %> | 9 | <%= will_paginate @assets %> |
| 10 | 10 | ||
| 11 | <table class="assets_table"> | 11 | <table class="admin_table assets_table"> |
| 12 | <tr class="header"> | 12 | <thead> |
| 13 | <th><%= t("admin.columns.preview") %></th> | 13 | <tr class="header"> |
| 14 | <th><%= t("admin.columns.name") %></th> | 14 | <th><%= t("admin.columns.preview") %></th> |
| 15 | <th></th> | 15 | <th><%= t("admin.columns.name") %></th> |
| 16 | </tr> | 16 | <th></th> |
| 17 | <% @assets.each do |asset| %> | 17 | </tr> |
| 18 | <tr> | 18 | </thead> |
| 19 | <td class="asset_thumb"> | 19 | <tbody> |
| 20 | <% if asset.has_variant?(:thumb) %> | 20 | <% @assets.each do |asset| %> |
| 21 | <%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset, | 21 | <tr> |
| 22 | :class => "asset_thumb_link" %> | 22 | <td class="asset_thumb"> |
| 23 | <% end %> | 23 | <% if asset.has_variant?(:thumb) %> |
| 24 | </td> | 24 | <%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset, |
| 25 | <td> | 25 | :class => "asset_thumb_link" %> |
| 26 | <div class="asset_name"> | 26 | <% end %> |
| 27 | <%= link_to asset.name.presence || asset.upload_file_name, asset %> | 27 | </td> |
| 28 | </div> | 28 | <td> |
| 29 | <div class="asset_meta asset_file"> | 29 | <div class="row_primary asset_name"> |
| 30 | <%= icon("external-link", library: "tabler", "aria-hidden": true) %> | 30 | <%= link_to asset.name.presence || asset.upload_file_name, asset %> |
| 31 | <%= link_to asset.upload_file_name, asset.upload.url, | 31 | </div> |
| 32 | :target => "_blank", :rel => "noopener" %> | 32 | <div class="row_secondary asset_meta asset_file"> |
| 33 | </div> | 33 | <%= icon("external-link", library: "tabler", "aria-hidden": true) %> |
| 34 | <div class="asset_meta asset_type"> | 34 | <%= link_to asset.upload_file_name, asset.upload.url, |
| 35 | <%= asset.upload.content_type %> · | 35 | :target => "_blank", :rel => "noopener" %> |
| 36 | <%= number_to_human_size(asset.upload.size) %> | 36 | </div> |
| 37 | </div> | 37 | <div class="row_secondary asset_meta asset_type"> |
| 38 | </td> | 38 | <%= asset.upload.content_type %> · |
| 39 | <td class="actions"> | 39 | <%= number_to_human_size(asset.upload.size) %> |
| 40 | <div class="action_grid"> | 40 | </div> |
| 41 | <span class="action_item"> | 41 | </td> |
| 42 | <%= link_to asset, "aria-label" => t("admin.common.show"), | 42 | <td class="actions"> |
| 43 | title: t("admin.common.show") do %> | 43 | <div class="action_grid"> |
| 44 | <%= icon("eye", library: "tabler", "aria-hidden": true) %> | 44 | <span class="action_item"> |
| 45 | <% end %> | 45 | <%= link_to asset, "aria-label" => t("admin.common.show"), |
| 46 | </span> | 46 | title: t("admin.common.show") do %> |
| 47 | <span class="action_item"> | 47 | <%= icon("eye", library: "tabler", "aria-hidden": true) %> |
| 48 | <%= link_to edit_asset_path(asset), "aria-label" => t("admin.common.edit"), | 48 | <% end %> |
| 49 | title: t("admin.common.edit") do %> | 49 | </span> |
| 50 | <%= icon("edit", library: "tabler", "aria-hidden": true) %> | 50 | <span class="action_item"> |
| 51 | <% end %> | 51 | <%= link_to edit_asset_path(asset), "aria-label" => t("admin.common.edit"), |
| 52 | </span> | 52 | title: t("admin.common.edit") do %> |
| 53 | <span class="action_item"> | 53 | <%= icon("edit", library: "tabler", "aria-hidden": true) %> |
| 54 | <%= button_to asset, method: :delete, | 54 | <% end %> |
| 55 | form: { data: { confirm: t("admin.common.confirm_sure") }, | 55 | </span> |
| 56 | class: 'button_to destructive' }, | 56 | <span class="action_item"> |
| 57 | "aria-label" => t("admin.common.destroy"), | 57 | <%= button_to asset, method: :delete, |
| 58 | title: t("admin.common.destroy") do %> | 58 | form: { data: { confirm: t("admin.common.confirm_sure") }, |
| 59 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> | 59 | class: 'button_to destructive' }, |
| 60 | <% end %> | 60 | "aria-label" => t("admin.common.destroy"), |
| 61 | </span> | 61 | title: t("admin.common.destroy") do %> |
| 62 | </div> | 62 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> |
| 63 | </td> | 63 | <% end %> |
| 64 | </tr> | 64 | </span> |
| 65 | <% end %> | 65 | </div> |
| 66 | </td> | ||
| 67 | </tr> | ||
| 68 | <% end %> | ||
| 69 | </tbody> | ||
| 66 | </table> | 70 | </table> |
