From a1794d3087e6cbd228f3641e7313815d8c59695f Mon Sep 17 00:00:00 2001
From: erdgeist
Date: Thu, 20 Aug 2026 17:37:01 +0200
Subject: Surface redirects in nodes#show, the action log and when publishing
---
app/views/nodes/show.html.erb | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
(limited to 'app/views/nodes/show.html.erb')
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index 24ac4084..d8c08eb1 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -9,14 +9,35 @@
<%= t(".head") %>
+ <% if @node.head&.redirect.present? %>
+
+ <%= flag("arrow-ramp-right",
+ redirect_flag_hint(@node.head),
+ :tier => :attention) %>
+
+ <% end %>
<%= @node.head ? t(".head_line", :title => @node.head.title, :rev => @node.head.revision, :time => @node.head.updated_at) : t(".never_published") %>
<%= t(".draft") %>
+ <% if @node.draft&.redirect.present? %>
+
+ <%= flag("arrow-ramp-right",
+ redirect_flag_hint(@node.draft),
+ :tier => :attention) %>
+
+ <% end %>
<%= @node.draft ? t(".draft_line", :title => @node.draft.title, :rev => @node.draft.revision, :time => @node.draft.updated_at) : t(".none") %>
<%= t(".autosave") %>
+ <% if @node.autosave&.redirect.present? %>
+
+ <%= flag("arrow-ramp-right",
+ redirect_flag_hint(@node.autosave),
+ :tier => :attention) %>
+
+ <% end %>
<%= @node.autosave ? t(".autosave_line", :title => @node.autosave.title, :time => @node.autosave.updated_at) : t(".none") %>
@@ -56,6 +77,11 @@
<% confirm += " " + t(".confirm_publish_moves",
:path => @node.prospective_unique_name) %>
<% end %>
+ <% if @node.draft.redirect.present? && @node.head&.redirect.blank? %>
+ <% confirm += " " + t(".confirm_publish_redirects") %>
+ <% elsif @node.draft.redirect.present? && @node.draft.redirect_differs_from?(@node.head) %>
+ <% confirm += " " + t(".confirm_publish_redirect_changes") %>
+ <% end %>
<%= button_to t(".publish"), publish_node_path(@node), method: :put,
form: { data: { confirm: confirm }, class: 'button_to state_changing' } %>
<% else %>
@@ -246,6 +272,17 @@
<% end %>
+ <% if (redirect = @node.head&.redirect_target) %>
+
+ <%= icon("arrow-right", library: "tabler", "aria-hidden": true) %>
+ <% if redirect.internal? %>
+ <%= t(".redirects_to", :path => redirect.node.unique_name) %>
+ <% else %>
+ <%= t(".redirects_to_url", :url => redirect.url) %>
+ <% end %>
+
+ <% end %>
+