From 15aff3eff51809d1ce21caab406a0ef8b13624b6 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 11 Jul 2026 01:33:07 +0200 Subject: Do not offer to destroy the only draft of a never-published node --- app/views/nodes/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index 5756649..07cb5d1 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb @@ -49,7 +49,7 @@ form: { data: { confirm: "Publish this draft?" }, class: 'button_to state_changing' } %> <% end %> - <% if @node.draft || @node.autosave %> + <% if @node.autosave || (@node.draft && @node.head) %>
<%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard Autosave'), revert_node_path(@node), method: :put, -- cgit v1.3