From e19787c6ca542736db40e042554f5c0103531821 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 6 Aug 2026 05:17:27 +0200 Subject: Rebuild the sitemap rows around the shared title and action patterns --- app/views/nodes/sitemap.html.erb | 50 ++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'app/views/nodes/sitemap.html.erb') diff --git a/app/views/nodes/sitemap.html.erb b/app/views/nodes/sitemap.html.erb index ea64b356..019d4c92 100644 --- a/app/views/nodes/sitemap.html.erb +++ b/app/views/nodes/sitemap.html.erb @@ -1,23 +1,55 @@ -

<%= t(".title") %>

+<%= render "shared/page_actions", + :title => t(".title"), + :icon_name => "file-plus", + :label => t(".create_at_root"), + :options => [[t(".create_at_root"), new_node_path(:parent_id => Node.root.id)]] %>
+ <% open_details = [] # levels with a currently-open
+ world_icon = icon("world", library: "tabler", "aria-hidden": true) + create_icon = icon("file-plus", library: "tabler", "aria-hidden": true) + show_icon = icon("eye", library: "tabler", "aria-hidden": true) %> + <% @sitemap.each_with_index do |(node, level), index| %> <% while open_details.any? && open_details.last >= level %>
<% open_details.pop %> <% end %> -
-

<%= link_to title_for_node(node), node_path(node) %>

- <%= link_to_path("#{node.unique_name} ↗", node.unique_name) %> -

- <%= link_to 'Show', node_path(node) %> - <%= link_to 'Create Child', new_node_path(:parent_id => node.id) %> -

-
+ <% unless level.zero? %> +
+
+ + <%= flag("file-text-shield", t(".flag_restricted"), :tier => :attention) if node.restricted? %> + <%= flag("external-link", t(".flag_external")) if node.external_url.present? %> + +
+
<%= link_to title_for_node(node), node_path(node) %>
+
+ <%= world_icon %> + <%= link_to_path(node.unique_name, node.unique_name) %> +
+
+
+ + <%= link_to new_node_path(:parent_id => node.id), + "aria-label" => t(".create_child"), title: t(".create_child") do %> + <%= create_icon %> + <% end %> + + + <%= link_to node_path(node), "aria-label" => t("admin.common.show"), + title: t("admin.common.show") do %> + <%= show_icon %> + <% end %> + +
+
+
+ <% end %> <% next_level = @sitemap[index + 1]&.last %> <% if next_level && next_level > level %> -- cgit v1.3