summaryrefslogtreecommitdiff
path: root/app/models/node.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-08 17:32:17 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-08 17:32:17 +0200
commitbc03601ee5c7acd4ef012ec4a404bd7b76bceaa0 (patch)
tree9b160ea6194ffe27b6d8471b92a84bd0bdad4e2b /app/models/node.rb
parent6ad96c44d04df01e6abde097c681e824dd5fe745 (diff)
Add revert!/discard and rebuild nodes#edit around the new hierarchy
revert! discards exactly the topmost non-empty layer -- autosave if present, else draft -- and reveals whatever's beneath it, releasing the lock only once nothing is left to protect. Guards against destroying a brand-new, never-published node's only draft, which would violate the (head | draft) invariant every other method here assumes holds; the view's Destroy/Discard button is gated the same way. nodes#edit now calls lock_for_editing! instead of find_or_create_draft, and always displays autosave || draft || head, resurrecting an abandoned session's unsaved content by default with an explicit flash explaining what's shown and how to get back to the last saved version. The view drops content_for :subnavigation entirely: Show becomes "Unlock + Back", Preview stays a plain link, metadata's own <details> already replaced the old toggle, and Publish moves off this page for good, per the earlier decision to manage the publish lifecycle entirely from nodes#show. Save Draft and Save + Unlock + Exit appear both above and below the form, given the body field alone runs 600px on desktop.
Diffstat (limited to 'app/models/node.rb')
0 files changed, 0 insertions, 0 deletions