From d41ee504caedbe858e24ab2a23c7a804454c64c8 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 18 Jul 2026 02:15:29 +0200 Subject: Add Trash affordances: cockpit, listing, dashboard entry nodes#show gains a Trash section on trashed nodes: provenance from the trash entry, a restore form whose parent picker pre-fills the old parent while it still lives, and permanent deletion. A Move-to-Trash button joins the status actions on living nodes. nodes#trashed lists trashed subtree roots with weight, provenance, and deletion; the dashboard housekeeping row links to it, and trash/destroy redirect there. Deletion from Trash now removes the whole subtree, deepest first, each node through a real destroy! so every per-node cascade runs -- amending the never-recursive rule for this one sanctioned path (both confirms state the count; the root entry carries destroyed_descendants). Bare Node#destroy still refuses children. --- app/views/admin/index.html.erb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/views/admin') diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index 7933cba..319530d 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb @@ -68,5 +68,9 @@ <%= link_to menu_items_path, class: "action_button" do %> <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> Navigation <% end %> + <% trash_count = Node.trash.children.count %> + <%= link_to trashed_nodes_path, class: "action_button" do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> Trash<%= " (#{trash_count})" if trash_count > 0 %> + <% end %> -- cgit v1.3