Move list of containing relations to top of browse views

Moves the list of containing relations to above the list of
members for ways and relations - nodes have no equivalent list
so no change is needed there.

Fixes #794
Closes #1501
This commit is contained in:
daganzdaanda 2017-04-24 20:23:46 +01:00 committed by Tom Hughes
parent 6fcc2e55f9
commit 8b68acec3e
2 changed files with 12 additions and 12 deletions

View file

@ -10,14 +10,14 @@
<div class='browse-section browse-relation'> <div class='browse-section browse-relation'>
<%= render :partial => "common_details", :object => relation %> <%= render :partial => "common_details", :object => relation %>
<% unless relation.relation_members.empty? %>
<h4><%= t'browse.relation.members' %></h4>
<ul><%= render :partial => "relation_member", :collection => relation.relation_members %></ul>
<% end %>
<% unless relation.containing_relation_members.empty? %> <% unless relation.containing_relation_members.empty? %>
<h4><%= t'browse.part_of' %></h4> <h4><%= t'browse.part_of' %></h4>
<ul><%= render :partial => "containing_relation", :collection => relation.containing_relation_members.uniq %></ul> <ul><%= render :partial => "containing_relation", :collection => relation.containing_relation_members.uniq %></ul>
<% end %> <% end %>
<% unless relation.relation_members.empty? %>
<h4><%= t'browse.relation.members' %></h4>
<ul><%= render :partial => "relation_member", :collection => relation.relation_members %></ul>
<% end %>
</div> </div>
<% end %> <% end %>

View file

@ -10,6 +10,13 @@
<div class='browse-section browse-way'> <div class='browse-section browse-way'>
<%= render :partial => "common_details", :object => way %> <%= render :partial => "common_details", :object => way %>
<% unless way.containing_relation_members.empty? %>
<h4><%= t'browse.part_of' %></h4>
<ul>
<%= render :partial => "containing_relation", :collection => way.containing_relation_members.uniq %>
</ul>
<% end %>
<% unless way.way_nodes.empty? %> <% unless way.way_nodes.empty? %>
<h4><%= t'browse.way.nodes' %></h4> <h4><%= t'browse.way.nodes' %></h4>
<ul> <ul>
@ -24,12 +31,5 @@
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>
<% unless way.containing_relation_members.empty? %>
<h4><%= t'browse.part_of' %></h4>
<ul>
<%= render :partial => "containing_relation", :collection => way.containing_relation_members.uniq %>
</ul>
<% end %>
</div> </div>
<% end %> <% end %>