diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 02:15:29 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 02:15:29 +0200 |
| commit | d41ee504caedbe858e24ab2a23c7a804454c64c8 (patch) | |
| tree | eb3ec7c8f44d15fea40292d0a9e7358e41640edc /public | |
| parent | 5dced8b4b624aabf4215ba21b13957080345c326 (diff) | |
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.
Diffstat (limited to 'public')
| -rw-r--r-- | public/javascripts/admin_interface.js | 4 | ||||
| -rw-r--r-- | public/javascripts/admin_search.js | 13 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 35 |
3 files changed, 52 insertions, 0 deletions
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 3988016..c0e2d9c 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js | |||
| @@ -57,6 +57,10 @@ $(document).ready(function () { | |||
| 57 | move_to_search.initialize_search(); | 57 | move_to_search.initialize_search(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | if ($("#restore_search_term").length != 0) { | ||
| 61 | restore_search.initialize_search(); | ||
| 62 | } | ||
| 63 | |||
| 60 | if ($("#event_node_search_term").length != 0) { | 64 | if ($("#event_node_search_term").length != 0) { |
| 61 | event_search.initialize_search(); | 65 | event_search.initialize_search(); |
| 62 | } | 66 | } |
diff --git a/public/javascripts/admin_search.js b/public/javascripts/admin_search.js index d135503..b53c931 100644 --- a/public/javascripts/admin_search.js +++ b/public/javascripts/admin_search.js | |||
| @@ -262,6 +262,19 @@ move_to_search = { | |||
| 262 | } | 262 | } |
| 263 | }; | 263 | }; |
| 264 | 264 | ||
| 265 | restore_search = { | ||
| 266 | initialize_search : function() { | ||
| 267 | initSearchPicker({ | ||
| 268 | inputSelector: "#restore_search_term", | ||
| 269 | resultsSelector: "#restore_search_results", | ||
| 270 | onSelect: function(node) { | ||
| 271 | $("#restore_search_term").val(node.title); | ||
| 272 | $("#parent_id").val(node.node_id); | ||
| 273 | } | ||
| 274 | }); | ||
| 275 | } | ||
| 276 | }; | ||
| 277 | |||
| 265 | event_search = { | 278 | event_search = { |
| 266 | initialize_search : function() { | 279 | initialize_search : function() { |
| 267 | initSearchPicker({ | 280 | initSearchPicker({ |
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 82963dd..88fd84b 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -884,6 +884,10 @@ form.button_to button[type="submit"] { | |||
| 884 | margin-top: -5px; | 884 | margin-top: -5px; |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | .aligned_action_row .action_button.action_button_no_margin_top { | ||
| 888 | margin-top: 0; | ||
| 889 | } | ||
| 890 | |||
| 887 | /* ============================================================ | 891 | /* ============================================================ |
| 888 | Page editor / metadata forms | 892 | Page editor / metadata forms |
| 889 | ============================================================ */ | 893 | ============================================================ */ |
| @@ -1539,3 +1543,34 @@ div#image_browser ul li { | |||
| 1539 | font-size: smaller; | 1543 | font-size: smaller; |
| 1540 | color: #777; | 1544 | color: #777; |
| 1541 | } | 1545 | } |
| 1546 | |||
| 1547 | /* ============================================================ | ||
| 1548 | Trash section | ||
| 1549 | ============================================================ */ | ||
| 1550 | |||
| 1551 | .restore_form { | ||
| 1552 | display: flex; | ||
| 1553 | align-items: center; | ||
| 1554 | gap: 8px; | ||
| 1555 | } | ||
| 1556 | |||
| 1557 | .restore_picker { | ||
| 1558 | position: relative; | ||
| 1559 | } | ||
| 1560 | |||
| 1561 | .restore_picker input[type=text] { | ||
| 1562 | width: 22em; | ||
| 1563 | } | ||
| 1564 | |||
| 1565 | .restore_picker .search_results { | ||
| 1566 | position: absolute; | ||
| 1567 | top: 100%; | ||
| 1568 | left: 0; | ||
| 1569 | right: 0; | ||
| 1570 | z-index: 10; | ||
| 1571 | background: #fff; | ||
| 1572 | border: 1px solid #989898; | ||
| 1573 | border-top: none; | ||
| 1574 | max-height: 20em; | ||
| 1575 | overflow-y: auto; | ||
| 1576 | } | ||
