<%= 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 %> <% 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 %> > <%= t(".descendants", :count => @sitemap_descendant_counts[node.id]) %> <% open_details.push(level) %> <% end %> <% end %> <% open_details.length.times { %><% } %>