summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/nodes/show.html.erb11
-rw-r--r--app/views/nodes/sitemap.html.erb50
2 files changed, 51 insertions, 10 deletions
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index a94e001c..105e37ea 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -231,7 +231,7 @@
231 <% end %> 231 <% end %>
232 </div> 232 </div>
233 233
234 <% if @node.head %> 234 <% if @node.head && !@node.root? %>
235 <div class="link_matrix_row"> 235 <div class="link_matrix_row">
236 <span class="link_matrix_label"> 236 <span class="link_matrix_label">
237 <span class="info_label"><%= t(".public") %></span> 237 <span class="info_label"><%= t(".public") %></span>
@@ -251,6 +251,15 @@
251 </div> 251 </div>
252 <% end %> 252 <% end %>
253 253
254 <% if @node.root? %>
255 <div class="link_matrix_row">
256 <span class="link_matrix_label">
257 <span class="info_label"><%= t(".public") %></span>
258 <span class="field_hint"><%= t(".root_has_no_public_url") %></span>
259 </span>
260 </div>
261 <% end %>
262
254 <% if @node.draft %> 263 <% if @node.draft %>
255 <div class="link_matrix_row"> 264 <div class="link_matrix_row">
256 <span class="link_matrix_label"> 265 <span class="link_matrix_label">
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 @@
1<h1><%= t(".title") %></h1> 1<%= render "shared/page_actions",
2 :title => t(".title"),
3 :icon_name => "file-plus",
4 :label => t(".create_at_root"),
5 :options => [[t(".create_at_root"), new_node_path(:parent_id => Node.root.id)]] %>
2 6
3<div id="sitemap"> 7<div id="sitemap">
8
4<% 9<%
5 open_details = [] # levels with a currently-open <details> 10 open_details = [] # levels with a currently-open <details>
11 world_icon = icon("world", library: "tabler", "aria-hidden": true)
12 create_icon = icon("file-plus", library: "tabler", "aria-hidden": true)
13 show_icon = icon("eye", library: "tabler", "aria-hidden": true)
6%> 14%>
15
7<% @sitemap.each_with_index do |(node, level), index| %> 16<% @sitemap.each_with_index do |(node, level), index| %>
8 <% while open_details.any? && open_details.last >= level %> 17 <% while open_details.any? && open_details.last >= level %>
9 </details> 18 </details>
10 <% open_details.pop %> 19 <% open_details.pop %>
11 <% end %> 20 <% end %>
12 21
13 <div class="sitemap_node"> 22 <% unless level.zero? %>
14 <h4><%= link_to title_for_node(node), node_path(node) %></h4> 23 <div class="sitemap_node">
15 <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span> 24 <div class="title_with_flags">
16 <p class="sitemap_node_actions"> 25 <span class="flag_stack">
17 <%= link_to 'Show', node_path(node) %> 26 <%= flag("file-text-shield", t(".flag_restricted"), :tier => :attention) if node.restricted? %>
18 <%= link_to 'Create Child', new_node_path(:parent_id => node.id) %> 27 <%= flag("external-link", t(".flag_external")) if node.external_url.present? %>
19 </p> 28 </span>
20 </div> 29 <div class="title_body">
30 <div class="node_title"><%= link_to title_for_node(node), node_path(node) %></div>
31 <div class="node_path">
32 <%= world_icon %>
33 <%= link_to_path(node.unique_name, node.unique_name) %>
34 </div>
35 </div>
36 <div class="action_grid">
37 <span class="action_item">
38 <%= link_to new_node_path(:parent_id => node.id),
39 "aria-label" => t(".create_child"), title: t(".create_child") do %>
40 <%= create_icon %>
41 <% end %>
42 </span>
43 <span class="action_item">
44 <%= link_to node_path(node), "aria-label" => t("admin.common.show"),
45 title: t("admin.common.show") do %>
46 <%= show_icon %>
47 <% end %>
48 </span>
49 </div>
50 </div>
51 </div>
52 <% end %>
21 53
22 <% next_level = @sitemap[index + 1]&.last %> 54 <% next_level = @sitemap[index + 1]&.last %>
23 <% if next_level && next_level > level %> 55 <% if next_level && next_level > level %>