summaryrefslogtreecommitdiff
path: root/app/views/admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
commit8eab68f2c5a3c126e2fec2ecdfa7ace87ce0937b (patch)
treef446ebc26a7707c7b64a937aa51a155df146c80a /app/views/admin
parent42714c697273a7117c6b355fab26c8c35e336ad1 (diff)
parentcdf5d9941ca866d437612d2f863eac6eb0b3db12 (diff)
Merge branch 'erdgeist-revive-events'
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/_drafts.html.erb2
-rw-r--r--app/views/admin/_menu.html.erb13
-rw-r--r--app/views/admin/conventions.html.erb11
-rw-r--r--app/views/admin/index.html.erb202
-rw-r--r--app/views/admin/search_results.html.erb11
5 files changed, 92 insertions, 147 deletions
diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb
index a35b0ab..4ef568f 100644
--- a/app/views/admin/_drafts.html.erb
+++ b/app/views/admin/_drafts.html.erb
@@ -17,7 +17,7 @@
17 <td class="actions"> 17 <td class="actions">
18 <%= link_to 'Show', node_path(draft.node) %> 18 <%= link_to 'Show', node_path(draft.node) %>
19 <%= link_to "Revisions", revision_path(draft.node.id) %> 19 <%= link_to "Revisions", revision_path(draft.node.id) %>
20 <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" } } %> 20 <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" }, class: 'button_to state_changing' } %>
21 </td> 21 </td>
22 </tr> 22 </tr>
23 <% end %> 23 <% end %>
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb
index 6dba085..970429d 100644
--- a/app/views/admin/_menu.html.erb
+++ b/app/views/admin/_menu.html.erb
@@ -1,8 +1,5 @@
1<%= language_selector %> 1<%= link_to icon("home", library: "tabler", "aria-hidden": true), admin_path, "aria-label": "Dashboard" %>
2<%= button_to 'Logout', logout_path, method: :delete %> 2<a href="#" onclick="admin_search.display_toggle(); return false;" aria-label="Search"><%= icon("search", library: "tabler", "aria-hidden": true) %></a>
3<%= link_to 'Overview', admin_path %> 3<%= button_to logout_path, method: :delete, aria: { label: "Log out" } do %>
4<a href="#" onclick="admin_search.display_toggle(); return false;">search</a> 4 <%= icon("logout", library: "tabler", "aria-hidden": true) %>
5<%= link_to 'Nodes', nodes_path, selected?('nodes') %> 5<% end %>
6<%= link_to 'Assets', assets_path, selected?('assets') %>
7<%= link_to 'User', users_path, selected?('users') %>
8<%= link_to 'Navigation', menu_items_path, selected?('menu_items') %> &gt;&nbsp;
diff --git a/app/views/admin/conventions.html.erb b/app/views/admin/conventions.html.erb
new file mode 100644
index 0000000..72f6214
--- /dev/null
+++ b/app/views/admin/conventions.html.erb
@@ -0,0 +1,11 @@
1<h1>Node creation conventions</h1>
2
3<table id="conventions">
4 <tr><th>Kind</th><th>What happens</th></tr>
5 <% @node_kinds.each do |kind, config| %>
6 <tr>
7 <td><%= kind %></td>
8 <td><%= resolve_kind_text(config[:label]) %> — <%= resolve_kind_text(config[:hint]) %></td>
9 </tr>
10 <% end %>
11</table>
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb
index 2741db3..bdb555e 100644
--- a/app/views/admin/index.html.erb
+++ b/app/views/admin/index.html.erb
@@ -1,147 +1,81 @@
1<div id="admin_wizard"> 1<h1>cccms dashboard</h1>
2 <div class="admin_wizard_button"><%= link_to 'Create Update or Pressemitteilung', new_node_path, :only_path => false %></div> 2<div id="dashboard_search">
3 <div class="admin_wizard_button"><a href="#" id="admin_wizard_my_work" class="button">Continue my work</a></div> 3 <%= form_tag admin_search_path, method: :get do %>
4 <div class="admin_wizard_button"><a href="#" id="admin_wizard_create_page" class="button">Add a page in the page tree</a></div> 4 <%= text_field_tag :search_term, nil, id: "dashboard_search_term", placeholder: "Search nodes and tags…", autocomplete: "off" %>
5 <div class="admin_wizard_button"><%= link_to("Upload a new asset", new_asset_path, :only_path => false) %></div> 5 <% end %>
6 <div id="dashboard_search_results" class="search_results"></div>
6</div> 7</div>
7 8
8<p id="overview_toggle"> 9<div id="dashboard_signposts" class="button_row">
9 <a href="#" id="recent_changes_toggle" class="button">recent changes</a> 10 <%= link_to new_node_path, class: "action_button" do %>
10 <a href="#" id="my_work_toggle" class="button">my work</a> 11 <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create post
11 <a href="#" id="current_drafts_toggle" class="button">current drafts (<%= @drafts_count %>)</a> 12 <% end %>
12 <a href="#" id="admin_sitemap_toggle" class="button">site map</a> 13 <%= link_to chapters_nodes_path, class: "action_button" do %>
13</p> 14 <%= icon("map-pin", library: "tabler", "aria-hidden": true) %> Find a chapter
15 <% end %>
16 <%= link_to new_asset_path, class: "action_button" do %>
17 <%= icon("upload", library: "tabler", "aria-hidden": true) %> Upload asset
18 <% end %>
19 <%= link_to sitemap_nodes_path, class: "action_button" do %>
20 <%= icon("list-tree", library: "tabler", "aria-hidden": true) %> Add a page in the page tree
21 <% end %>
22</div>
14 23
15<div id="recent_changes_table"> 24<div id="dashboard_widgets">
16 25 <div class="dashboard_widget">
17 <h1>Recent Changes</h1> 26 <h3>Drafts and autosaves</h3>
27 <ul>
28 <% @drafts.each do |node| %>
29 <li>
30 <div>
31 <%= link_to title_for_node(node), node_path(node) %>
32 <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span>
33 </div>
34 <span class="dashboard_widget_meta">
35 <% if (editor = node_last_editor(node)) %><%= editor %>, <% end %><%= relative_time_phrase(node.updated_at) %>
36 </span>
37 </li>
38 <% end %>
39 </ul>
40 <%= link_to "See all drafts →", drafts_nodes_path %>
41 </div>
18 42
19 <table class="node_table"> 43 <div class="dashboard_widget">
20 <tr class="header"> 44 <h3>Recent changes</h3>
21 <th class="node_id">ID</th> 45 <ul>
22 <th class="title">Title</th>
23 <th class="actions">Actions</th>
24 <th class="editor">Locked by</th>
25 <th class="revision">Rev.</th>
26 </tr>
27 <% @recent_changes.each do |node| %> 46 <% @recent_changes.each do |node| %>
28 <tr class="<%= cycle("even", "odd") %>"> 47 <li>
29 <td class="node_id"><%= node.id %></td> 48 <div>
30 <td class="title"> 49 <%= link_to title_for_node(node), node_path(node) %>
31 <h4><%= link_to title_for_node(node), node_path(node) %></h4> 50 <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span>
32 <p><%= link_to_path(node.unique_name, node.unique_name) %></p> 51 </div>
33 </td> 52 <span class="dashboard_widget_meta">
34 <td class="actions"> 53 <%= (editor = node_head_editor(node)) ? t("published_by", editor: editor) : t("published") %>, <%= relative_time_phrase(node.head.updated_at) %>
35 <%= link_to 'show', node_path(node) %> 54 </span>
36 <%= link_to 'Revisions', node_revisions_path(node) %> 55 </li>
37 </td>
38 <td>
39 <%= node.lock_owner.login if node.lock_owner %>
40 </td>
41 <td>
42 <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
43 </td>
44 </tr>
45 <% end %> 56 <% end %>
46 </table> 57 </ul>
58 <%= link_to "See all recent changes →", recent_nodes_path %>
59 </div>
47</div> 60</div>
48 61
49<div id="my_work_table"> 62<div id="dashboard_housekeeping">
50 63 <h3>Housekeeping</h3>
51 <h1>My Work</h1> 64 <div class="button_row">
52 65 <%= link_to nodes_path, class: "action_button" do %>
53 <table class="node_table"> 66 <%= icon("list", library: "tabler", "aria-hidden": true) %> Nodes
54 <tr class="header">
55 <th class="node_id">ID</th>
56 <th class="title">Title</th>
57 <th class="actions">Actions</th>
58 <th class="editor">Locked by</th>
59 <th class="revision">Rev.</th>
60 </tr>
61 <% @mynodes.each do |node| %>
62 <tr class="<%= cycle("even", "odd") %>">
63 <td class="node_id"><%= node.id %></td>
64 <td class="title">
65 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
66 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
67 </td>
68 <td class="actions">
69 <%= link_to 'show', node_path(node) %>
70 <%= link_to 'Revisions', node_revisions_path(node) %>
71 </td>
72 <td>
73 <%= node.lock_owner.login if node.lock_owner %>
74 </td>
75 <td>
76 <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
77 </td>
78 </tr>
79 <% end %> 67 <% end %>
80 </table> 68 <%= link_to events_path, class: "action_button" do %>
81</div> 69 <%= icon("calendar", library: "tabler", "aria-hidden": true) %> Events
82
83<div id="current_drafts_table">
84
85 <h1>Current Drafts (<%= @drafts_count %>)</h1>
86
87 <table class="node_table">
88 <tr class="header">
89 <th class="node_id">ID</th>
90 <th class="title">Title</th>
91 <th class="actions">Actions</th>
92 <th class="editor">Locked by</th>
93 <th class="revision">Rev.</th>
94 </tr>
95 <% @drafts.each do |node| %>
96 <tr class="<%= cycle("even", "odd") %>">
97 <td class="node_id"><%= node.id %></td>
98 <td class="title">
99 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
100 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
101 </td>
102 <td class="actions">
103 <%= link_to 'show', node_path(node) %>
104 <%= link_to 'Revisions', node_revisions_path(node) %>
105 </td>
106 <td>
107 <%= node.lock_owner.login if node.lock_owner %>
108 </td>
109 <td>
110 <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
111 </td>
112 </tr>
113 <% end %> 70 <% end %>
114 </table> 71 <%= link_to assets_path, class: "action_button" do %>
115</div> 72 <%= icon("folder", library: "tabler", "aria-hidden": true) %> Assets
116 73 <% end %>
117<div id="admin_sitemap_table"> 74 <%= link_to users_path, class: "action_button" do %>
118 75 <%= icon("users", library: "tabler", "aria-hidden": true) %> Users
119 <h1>Sitemap</h1>
120
121 <table class="node_table">
122 <tr class="header">
123 <th class="node_id">ID</th>
124 <th class="title">Title</th>
125 <th class="actions">Actions</th>
126 <th class="editor">Locked by</th>
127 </tr>
128 <% @sitemap.each do |node| %>
129 <% if !node.nil? %>
130 <tr class="<%= cycle("even", "odd") %>">
131 <td class="node_id" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"><%= node.id %></td>
132 <td class="title" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;">
133 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
134 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
135 </td>
136 <td class="actions">
137 <%= link_to 'create subpage', new_node_path(:parent_id => node.id) %>
138 <%= link_to 'Revisions', node_revisions_path(node) %>
139 </td>
140 <td>
141 <%= node.lock_owner.login if node.lock_owner %>
142 </td>
143 </tr>
144 <% end %> 76 <% end %>
77 <%= link_to menu_items_path, class: "action_button" do %>
78 <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> Navigation
145 <% end %> 79 <% end %>
146 </table> 80 </div>
147</div> 81</div>
diff --git a/app/views/admin/search_results.html.erb b/app/views/admin/search_results.html.erb
index f8aece0..a757197 100644
--- a/app/views/admin/search_results.html.erb
+++ b/app/views/admin/search_results.html.erb
@@ -1,7 +1,10 @@
1<h1>Search Results</h1> 1<h1>Search Results</h1>
2 2
3<ul> 3<ul class="search_results_list">
4<%- @results.each do |result| %> 4 <% @results.each do |result| %>
5 <li><%= link_to "#{result.title} (#{result.unique_name})", edit_node_path(result) %></li> 5 <li>
6<% end %> 6 <%= link_to title_for_node(result), node_path(result) %>
7 <span class="field_hint"><%= link_to_path("#{result.unique_name} ↗", result.unique_name) %></span>
8 </li>
9 <% end %>
7</ul> 10</ul>