From 49de2e14972030a7ef0ca36a94ab55a23a2f3596 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 18 Jul 2026 04:33:53 +0200 Subject: Annotate the History list with each revision's lifecycle Each row in nodes#show's History section now carries terse badges from the action log: created, published, and restored (rollback re-promotion), with date and actor, rendered from entry metadata alone. Backfilled entries wear the inferred marker, so reconstructed provenance stays distinguishable from witnessed history. A revision that was published and later restored shows both badges chronologically -- its true biography. Only create and publish entries carry page_id; trash, restore, and destroy annotate the node's own log zoom instead of any single revision, by design. --- test/controllers/nodes_controller_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/controllers/nodes_controller_test.rb') diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb index 6e2ddb3..ddc4565 100644 --- a/test/controllers/nodes_controller_test.rb +++ b/test/controllers/nodes_controller_test.rb @@ -745,4 +745,16 @@ class NodesControllerTest < ActionController::TestCase assert_select "td", /quentin/ assert_select "form[action=?]", node_path(node), count: 1 end + +test "show annotates history rows with their lifecycle" do + login_as :quentin + node = Node.root.children.create!(:slug => "history_annotation_test") + Globalize.with_locale(I18n.default_locale) { node.draft.update!(:title => "Annotated") } + node.publish_draft!(users(:quentin)) + + get :show, params: { :id => node.id } + + assert_response :success + assert_select "span.revision_lifecycle", /quentin/ + end end -- cgit v1.3