From 529f81b28ed77c62acaa63fad957e751798f2440 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 31 Jul 2026 22:36:17 +0200 Subject: Warn before the gate refuses, and check restore destinations nodes#new marks the kinds that place under /updates, derived from each kind's own path_prefix. The three parent pickers mark candidates the current user cannot publish into; menu_search returns needs_redaktion per result, computed per user rather than as a bare restricted flag, and the menu-item picker opts out. restore_from_trash! checks its destination: the restore is the move, applied rather than staged, so no later publish would have caught it. The node returns as a draft either way. --- public/javascripts/admin_search.js | 8 ++++++++ public/stylesheets/admin.css | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'public') diff --git a/public/javascripts/admin_search.js b/public/javascripts/admin_search.js index 792849f7..37b696e4 100644 --- a/public/javascripts/admin_search.js +++ b/public/javascripts/admin_search.js @@ -46,6 +46,7 @@ function initSearchPicker(options) { var isActive = options.isActive; var resultsHeaderHtml = options.resultsHeaderHtml; var renderResults = options.renderResults; + var showRestricted = options.showRestricted; var loadOnFocus = options.loadOnFocus; // optional, fires an initial search on focus with no term typed yet var requestId = 0; var timeout; @@ -75,6 +76,10 @@ function initSearchPicker(options) { var anchor = $("").attr("href", onSelect ? "#" : node.node_path); anchor.append(document.createTextNode(node.title || "")); anchor.append($("", { "class": "result_path" }).text(node.unique_name || "")); + if (showRestricted && node.needs_redaktion) { + anchor.append($("", { "class": "restricted_result" }) + .text(ADMIN_STRINGS.needs_redaktion)); + } var link = $("

").append(anchor); if (onSelect) { @@ -192,6 +197,7 @@ parent_search = { initSearchPicker({ inputSelector: "#parent_search_term", resultsSelector: "#parent_search_results", + showRestricted: true, onSelect: function(node) { $("#parent_search_term").val(node.title); $("#parent_id").val(node.node_id).attr("data-unique-name", node.unique_name); @@ -248,6 +254,7 @@ move_to_search = { initSearchPicker({ inputSelector: "#move_to_search_term", resultsSelector: "#move_to_search_results", + showRestricted: true, onSelect: function(node) { $("#move_to_search_term").val(node.title); $("#node_staged_parent_id").val(node.node_id); @@ -261,6 +268,7 @@ restore_search = { initSearchPicker({ inputSelector: "#restore_search_term", resultsSelector: "#restore_search_results", + showRestricted: true, onSelect: function(node) { $("#restore_search_term").val(node.title); $("#parent_id").val(node.node_id); diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 55fdf15d..7f286705 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -889,6 +889,7 @@ div.layout_row_content { font-weight: bold; color: var(--text-muted); cursor: not-allowed; + line-height: 1.25rem; } .info_group .disabled_action svg { @@ -973,6 +974,10 @@ form.button_to button[type="submit"] { padding-bottom: 4px; } +.restricted_kind_hint { + color: var(--accent); +} + .action_button + .field_hint { display: inline; margin-left: 0.5rem; @@ -1459,6 +1464,12 @@ input#menu_item_title { padding-bottom: 4px; } +.search_results .restricted_result { + display: block; + font-size: 0.85rem; + color: var(--accent); +} + .search_results p.search_more { margin: 0; padding: 6px 4px; -- cgit v1.3