From c992d51fe230bdc5d76d6d5b8d5b856e762e0744 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sat, 4 Jan 2025 17:22:38 +0300 Subject: [PATCH] Move browse history template to old elements directory --- app/controllers/old_nodes_controller.rb | 1 - app/controllers/old_relations_controller.rb | 1 - app/controllers/old_ways_controller.rb | 1 - .../history.html.erb => old_elements/index.html.erb} | 0 test/controllers/old_nodes_controller_test.rb | 6 +++--- test/controllers/old_relations_controller_test.rb | 6 +++--- test/controllers/old_ways_controller_test.rb | 6 +++--- 7 files changed, 9 insertions(+), 12 deletions(-) rename app/views/{browse/history.html.erb => old_elements/index.html.erb} (100%) diff --git a/app/controllers/old_nodes_controller.rb b/app/controllers/old_nodes_controller.rb index 86ef4c235..288322eea 100644 --- a/app/controllers/old_nodes_controller.rb +++ b/app/controllers/old_nodes_controller.rb @@ -2,7 +2,6 @@ class OldNodesController < OldElementsController def index @type = "node" @feature = Node.preload(:node_tags, :old_nodes => [:old_tags, { :changeset => [:changeset_tags, :user] }]).find(params[:id]) - render "browse/history" rescue ActiveRecord::RecordNotFound render "browse/not_found", :status => :not_found end diff --git a/app/controllers/old_relations_controller.rb b/app/controllers/old_relations_controller.rb index ea4fb6d12..8c73eba24 100644 --- a/app/controllers/old_relations_controller.rb +++ b/app/controllers/old_relations_controller.rb @@ -2,7 +2,6 @@ class OldRelationsController < OldElementsController def index @type = "relation" @feature = Relation.preload(:relation_tags, :old_relations => [:old_tags, { :changeset => [:changeset_tags, :user], :old_members => :member }]).find(params[:id]) - render "browse/history" rescue ActiveRecord::RecordNotFound render "browse/not_found", :status => :not_found end diff --git a/app/controllers/old_ways_controller.rb b/app/controllers/old_ways_controller.rb index fe8814b2f..e7b0fed6e 100644 --- a/app/controllers/old_ways_controller.rb +++ b/app/controllers/old_ways_controller.rb @@ -2,7 +2,6 @@ class OldWaysController < OldElementsController def index @type = "way" @feature = Way.preload(:way_tags, :old_ways => [:old_tags, { :changeset => [:changeset_tags, :user], :old_nodes => { :node => [:node_tags, :ways] } }]).find(params[:id]) - render "browse/history" rescue ActiveRecord::RecordNotFound render "browse/not_found", :status => :not_found end diff --git a/app/views/browse/history.html.erb b/app/views/old_elements/index.html.erb similarity index 100% rename from app/views/browse/history.html.erb rename to app/views/old_elements/index.html.erb diff --git a/test/controllers/old_nodes_controller_test.rb b/test/controllers/old_nodes_controller_test.rb index abaf30d62..dea546316 100644 --- a/test/controllers/old_nodes_controller_test.rb +++ b/test/controllers/old_nodes_controller_test.rb @@ -14,7 +14,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest def test_history node = create(:node, :with_history) - sidebar_browse_check :node_history_path, node.id, "browse/history" + sidebar_browse_check :node_history_path, node.id, "old_elements/index" assert_select "h4", /^Version/ do assert_select "a[href='#{old_node_path node, 1}']", :text => "1", :count => 1 end @@ -27,7 +27,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest get node_history_path(:id => node) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" # there are 2 revisions of the redacted node, but only one # should be showing details here. @@ -46,7 +46,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest get node_history_path(:id => node, :params => { :show_redactions => true }) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" assert_select ".browse-section", 2 assert_select ".browse-section.browse-redacted", 0 diff --git a/test/controllers/old_relations_controller_test.rb b/test/controllers/old_relations_controller_test.rb index f5de706cf..395c89c2c 100644 --- a/test/controllers/old_relations_controller_test.rb +++ b/test/controllers/old_relations_controller_test.rb @@ -14,7 +14,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest def test_history relation = create(:relation, :with_history) - sidebar_browse_check :relation_history_path, relation.id, "browse/history" + sidebar_browse_check :relation_history_path, relation.id, "old_elements/index" assert_select "h4", /^Version/ do assert_select "a[href='#{old_relation_path relation, 1}']", :text => "1", :count => 1 end @@ -29,7 +29,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest get relation_history_path(:id => relation) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" # there are 4 revisions of the redacted relation, but only 2 # should be showing details here. @@ -48,7 +48,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest get relation_history_path(:id => relation, :params => { :show_redactions => true }) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" assert_select ".browse-section", 4 assert_select ".browse-section.browse-redacted", 0 diff --git a/test/controllers/old_ways_controller_test.rb b/test/controllers/old_ways_controller_test.rb index fcc2281b8..57be1943f 100644 --- a/test/controllers/old_ways_controller_test.rb +++ b/test/controllers/old_ways_controller_test.rb @@ -14,7 +14,7 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest def test_history way = create(:way, :with_history) - sidebar_browse_check :way_history_path, way.id, "browse/history" + sidebar_browse_check :way_history_path, way.id, "old_elements/index" assert_select "h4", /^Version/ do assert_select "a[href='#{old_way_path way, 1}']", :text => "1", :count => 1 end @@ -29,7 +29,7 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest get way_history_path(:id => way) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" # there are 4 revisions of the redacted way, but only 2 # should be showing details here. @@ -48,7 +48,7 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest get way_history_path(:id => way, :params => { :show_redactions => true }) assert_response :success - assert_template "browse/history" + assert_template "old_elements/index" assert_select ".browse-section", 4 assert_select ".browse-section.browse-redacted", 0 -- 2.39.5