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 +++++++++++++++++++++++++++++++++-------- app/views/events/index.html.erb | 24 ++++++++++++------ 2 files changed, 61 insertions(+), 19 deletions(-) (limited to 'app') 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 %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 51269282..2497a577 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -17,7 +17,7 @@ <% @events.each do |event| %> - +
<%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %> @@ -41,14 +41,22 @@
- <% if event.rrule.present? %> - <%= event_schedule_text(event) %> - <% if event.humanize_rrule.nil? && event.start_time %> -
<%= admin_date(event.start_time) %>
+
+ <% if event.rrule.present? %> + <% if event.humanize_rrule %> + <%= event_schedule_text(event) %> + <% else %> + + <%= t("events.schedule.unreadable") %> + + <% if event.start_time %> +
<%= admin_date(event.start_time) %>
+ <% end %> + <% end %> + <% else %> + <%= event_date_range(event) %> <% end %> - <% else %> - <%= event_date_range(event) %> - <% end %> +
-- cgit v1.3