From e119200c1f6d372673d40f778c1561fa3b1358eb Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 17 Jan 2024 21:32:57 +0300 Subject: [PATCH] Link to details from node version pages --- app/views/old_nodes/show.html.erb | 10 ++++++---- test/controllers/old_nodes_controller_test.rb | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/old_nodes/show.html.erb b/app/views/old_nodes/show.html.erb index ba7c10ecb..b69c29723 100644 --- a/app/views/old_nodes/show.html.erb +++ b/app/views/old_nodes/show.html.erb @@ -4,11 +4,13 @@ <%= render :partial => "browse/node", :object => @feature %> -<% unless @feature.redacted? %> -
+
+ <% unless @feature.redacted? %> <%= link_to t("browse.download_xml"), node_version_path(*@feature.id) %> -
-<% end %> + · + <% end %> + <%= link_to t("browse.view_details"), node_path(@feature.node_id) %> +
<% if @feature.version > 1 %> diff --git a/test/controllers/old_nodes_controller_test.rb b/test/controllers/old_nodes_controller_test.rb index 4263077c8..3f2958bd3 100644 --- a/test/controllers/old_nodes_controller_test.rb +++ b/test/controllers/old_nodes_controller_test.rb @@ -18,6 +18,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest assert_select "a[href='#{old_node_path node, 1}']", :count => 0 end assert_select ".secondary-actions a[href='#{node_version_path node, 1}']", :count => 1 + assert_select ".secondary-actions a[href='#{node_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{node_history_path node}']", :count => 1 end @@ -31,6 +32,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest assert_select "a[href='#{old_node_path node, 1}']", :count => 0 end assert_select ".secondary-actions a[href='#{node_version_path node, 1}']", :count => 1 + assert_select ".secondary-actions a[href='#{node_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{node_history_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{old_node_path node, 2}']", :count => 1 @@ -42,6 +44,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest assert_select "a[href='#{old_node_path node, 2}']", :count => 0 end assert_select ".secondary-actions a[href='#{node_version_path node, 2}']", :count => 1 + assert_select ".secondary-actions a[href='#{node_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{node_history_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{old_node_path node, 1}']", :count => 1 end @@ -54,6 +57,7 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template "old_nodes/show" assert_template :layout => "map" + assert_select ".secondary-actions a[href='#{node_path node}']", :count => 1 assert_select ".secondary-actions a[href='#{old_node_path node, 1}']", :count => 0 assert_select ".secondary-actions a[href='#{node_version_path node, 1}']", :count => 0 end -- 2.39.5