diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-06 03:30:47 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-06 03:30:47 +0200 |
| commit | 0d91c5a4aa47fa34e0dfe6742b94aa23d59544bc (patch) | |
| tree | befd0b3ea24ab610e939c3af27e238e4102131da /app | |
| parent | 6290c20464ad5c622e902b4dd0de217c374b5905 (diff) | |
Make the events and assets lists work on a phone
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/assets/index.html.erb | 56 | ||||
| -rw-r--r-- | app/views/events/index.html.erb | 24 |
2 files changed, 61 insertions, 19 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> |
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 @@ | |||
| 17 | 17 | ||
| 18 | <% @events.each do |event| %> | 18 | <% @events.each do |event| %> |
| 19 | <tr> | 19 | <tr> |
| 20 | <td> | 20 | <td class="title"> |
| 21 | <div class="title_with_flags"> | 21 | <div class="title_with_flags"> |
| 22 | <span class="flag_stack"> | 22 | <span class="flag_stack"> |
| 23 | <%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %> | 23 | <%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %> |
| @@ -41,14 +41,22 @@ | |||
| 41 | </div> | 41 | </div> |
| 42 | </td> | 42 | </td> |
| 43 | <td class="event_when"> | 43 | <td class="event_when"> |
| 44 | <% if event.rrule.present? %> | 44 | <div class="when_body"> |
| 45 | <span class="rrule_raw" title="<%= event.rrule %>"><%= event_schedule_text(event) %></span> | 45 | <% if event.rrule.present? %> |
| 46 | <% if event.humanize_rrule.nil? && event.start_time %> | 46 | <% if event.humanize_rrule %> |
| 47 | <div class="event_meta"><%= admin_date(event.start_time) %></div> | 47 | <span title="<%= event.rrule %>"><%= event_schedule_text(event) %></span> |
| 48 | <% else %> | ||
| 49 | <span class="rrule_raw" title="<%= event.rrule %>"> | ||
| 50 | <%= t("events.schedule.unreadable") %> | ||
| 51 | </span> | ||
| 52 | <% if event.start_time %> | ||
| 53 | <div class="event_meta"><%= admin_date(event.start_time) %></div> | ||
| 54 | <% end %> | ||
| 55 | <% end %> | ||
| 56 | <% else %> | ||
| 57 | <%= event_date_range(event) %> | ||
| 48 | <% end %> | 58 | <% end %> |
| 49 | <% else %> | 59 | </div> |
| 50 | <%= event_date_range(event) %> | ||
| 51 | <% end %> | ||
| 52 | </td> | 60 | </td> |
| 53 | <td class="actions"> | 61 | <td class="actions"> |
| 54 | <div class="action_grid"> | 62 | <div class="action_grid"> |
