]> git.openstreetmap.org Git - rails.git/commitdiff
Link to details from relation version pages
authorAnton Khorev <tony29@yandex.ru>
Wed, 17 Jan 2024 18:41:09 +0000 (21:41 +0300)
committerAnton Khorev <tony29@yandex.ru>
Tue, 23 Jan 2024 19:08:39 +0000 (22:08 +0300)
app/views/old_relations/show.html.erb
test/controllers/old_relations_controller_test.rb

index dd52b383370dbcb14cfd0748dc73cbae37e54947..29d0b0079c6dab4f239d23379b5816cc9b65197c 100644 (file)
@@ -4,11 +4,13 @@
 
 <%= render :partial => "browse/relation", :object => @feature %>
 
-<% unless @feature.redacted? %>
-  <div class='secondary-actions'>
+<div class='secondary-actions'>
+  <% unless @feature.redacted? %>
     <%= link_to t("browse.download_xml"), relation_version_path(*@feature.id) %>
-  </div>
-<% end %>
+    &middot;
+  <% end %>
+  <%= link_to t("browse.view_details"), relation_path(@feature.relation_id) %>
+</div>
 
 <div class='secondary-actions'>
   <% if @feature.version > 1 %>
index 5b7a67bf0caee16b2bb71423861f49ea4e10c649..311e5958a62378d2f326f87344a2ba9d8d3c048a 100644 (file)
@@ -18,6 +18,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='#{old_relation_path relation, 1}']", :count => 0
     end
     assert_select ".secondary-actions a[href='#{relation_version_path relation, 1}']", :count => 1
+    assert_select ".secondary-actions a[href='#{relation_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{relation_history_path relation}']", :count => 1
   end
 
@@ -31,6 +32,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='#{old_relation_path relation, 1}']", :count => 0
     end
     assert_select ".secondary-actions a[href='#{relation_version_path relation, 1}']", :count => 1
+    assert_select ".secondary-actions a[href='#{relation_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{relation_history_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{old_relation_path relation, 2}']", :count => 1
 
@@ -42,6 +44,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='#{old_relation_path relation, 2}']", :count => 0
     end
     assert_select ".secondary-actions a[href='#{relation_version_path relation, 2}']", :count => 1
+    assert_select ".secondary-actions a[href='#{relation_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{relation_history_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{old_relation_path relation, 1}']", :count => 1
   end
@@ -63,6 +66,7 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_template "old_relations/show"
     assert_template :layout => "map"
+    assert_select ".secondary-actions a[href='#{relation_path relation}']", :count => 1
     assert_select ".secondary-actions a[href='#{old_relation_path relation, 1}']", :count => 0
     assert_select ".secondary-actions a[href='#{relation_version_path relation, 1}']", :count => 0
   end