summaryrefslogtreecommitdiff
path: root/app/views/shared/_page_actions.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/_page_actions.html.erb')
-rw-r--r--app/views/shared/_page_actions.html.erb32
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>