diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-04 17:13:18 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-04 17:13:18 +0200 |
| commit | ac01156d00b24d14225c8e75979fb59bba69640d (patch) | |
| tree | f223b41358debb6cee45c5351d885505615b0e02 /app/views/shared | |
| parent | 409d71ed471703be8c56f2639a3ecb0fa387e6a7 (diff) | |
Tidy up headings on house keeping views
- Collapse page headers into one action row with an optional hint
- limit will_paginate to one row
Diffstat (limited to 'app/views/shared')
| -rw-r--r-- | app/views/shared/_page_actions.html.erb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/views/shared/_page_actions.html.erb b/app/views/shared/_page_actions.html.erb new file mode 100644 index 00000000..66aeb785 --- /dev/null +++ b/app/views/shared/_page_actions.html.erb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | <div class="page_actions"> | ||
| 2 | <h1><%= title %></h1> | ||
| 3 | |||
| 4 | <% if options.size == 1 %> | ||
| 5 | <%= link_to options.first.last, class: "action_button", | ||
| 6 | "aria-label" => options.first.first, title: options.first.first do %> | ||
| 7 | <%= icon(icon_name, library: "tabler", "aria-hidden": true) %> | ||
| 8 | <% end %> | ||
| 9 | <% else %> | ||
| 10 | <div class="page_action_group"> | ||
| 11 | <details class="action_menu"> | ||
| 12 | <summary class="action_button" aria-label="<%= label %>" title="<%= label %>"> | ||
| 13 | <%= icon(icon_name, library: "tabler", "aria-hidden": true) %> | ||
| 14 | <%= icon("chevron-down", library: "tabler", "aria-hidden": true) %> | ||
| 15 | </summary> | ||
| 16 | <div class="action_menu_items"> | ||
| 17 | <% options.each do |option_label, path| %> | ||
| 18 | <%= link_to option_label, path, class: "action_button" %> | ||
| 19 | <% end %> | ||
| 20 | </div> | ||
| 21 | </details> | ||
| 22 | |||
| 23 | <% if local_assigns[:hint].present? %> | ||
| 24 | <details class="action_hint"> | ||
| 25 | <summary aria-label="<%= t("admin.common.explain") %>" | ||
| 26 | title="<%= t("admin.common.explain") %>">?</summary> | ||
| 27 | <p><%= hint %></p> | ||
| 28 | </details> | ||
| 29 | <% end %> | ||
| 30 | </div> | ||
| 31 | <% end %> | ||
| 32 | </div> | ||
