From 0d91c5a4aa47fa34e0dfe6742b94aa23d59544bc Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 6 Aug 2026 03:30:47 +0200 Subject: Make the events and assets lists work on a phone --- app/views/assets/index.html.erb | 56 +++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'app/views/assets/index.html.erb') 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 @@ <%= t("admin.columns.preview") %> <%= t("admin.columns.name") %> - <%= t("admin.columns.type") %> - - <% @assets.each do |asset| %> - <% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %> - <%= link_to asset.name, asset.upload.url %> - <%= asset.upload.content_type %> - <%= link_to t("admin.common.show"), asset %> - <%= link_to t("admin.common.edit"), edit_asset_path(asset) %> - <%= 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 %> + + <% if asset.has_variant?(:thumb) %> + <%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset, + :class => "asset_thumb_link" %> + <% end %> + + +
+ <%= link_to asset.name.presence || asset.upload_file_name, asset %> +
+
+ <%= icon("external-link", library: "tabler", "aria-hidden": true) %> + <%= link_to asset.upload_file_name, asset.upload.url, + :target => "_blank", :rel => "noopener" %> +
+
+ <%= asset.upload.content_type %> ยท + <%= number_to_human_size(asset.upload.size) %> +
+ + +
+ + <%= link_to asset, "aria-label" => t("admin.common.show"), + title: t("admin.common.show") do %> + <%= icon("eye", library: "tabler", "aria-hidden": true) %> + <% end %> + + + <%= 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 %> + + + <%= 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 %> + +
+ <% end %> -- cgit v1.3