diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-08 17:32:17 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-08 17:32:17 +0200 |
| commit | bc03601ee5c7acd4ef012ec4a404bd7b76bceaa0 (patch) | |
| tree | 9b160ea6194ffe27b6d8471b92a84bd0bdad4e2b /config | |
| parent | 6ad96c44d04df01e6abde097c681e824dd5fe745 (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 'config')
| -rw-r--r-- | config/routes.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb index 1569a15..da46e5c 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -41,6 +41,7 @@ Cccms::Application.routes.draw do | |||
| 41 | put :generate_shared_preview | 41 | put :generate_shared_preview |
| 42 | put :revoke_shared_preview | 42 | put :revoke_shared_preview |
| 43 | put :autosave | 43 | put :autosave |
| 44 | put :revert | ||
| 44 | end | 45 | end |
| 45 | 46 | ||
| 46 | resources :revisions do | 47 | resources :revisions do |
