]> git.openstreetmap.org Git - rails.git/commitdiff
Uniqify lists of containing ways/relations
authorTom Hughes <tom@compton.nu>
Sun, 23 Feb 2014 00:08:51 +0000 (00:08 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 23 Feb 2014 00:08:51 +0000 (00:08 +0000)
Fixes #707

app/views/browse/_node.html.erb
app/views/browse/_relation.html.erb
app/views/browse/_way.html.erb

index 2c2cdd4c0eba40613edb6758e6bea2726bb716cf..581c49b09155b30435a499c9361040cc2b9aafcb 100644 (file)
     <% unless node.ways.empty? and node.containing_relation_members.empty? %>
       <h4><%= t 'browse.part_of' %></h4>
       <ul>
-        <% node.ways.each do |way| %>
+        <% node.ways.uniq.each do |way| %>
           <li><%= link_to h(printable_name(way)), { :action => "way", :id => way.id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
         <% end %>
-        <%= render :partial => "containing_relation", :collection => node.containing_relation_members %>
+        <%= render :partial => "containing_relation", :collection => node.containing_relation_members.uniq %>
       </ul>
     <% end %>
   </div>
index 10046d0bb8868802ad50f5f37c4dc6266ab1ce02..1644228ae69c8b6803d7f06e1c30963c73d239cf 100644 (file)
@@ -17,7 +17,7 @@
 
     <% unless relation.containing_relation_members.empty? %>
       <h4><%= t'browse.part_of' %></h4>
-      <ul><%= render :partial => "containing_relation", :collection => relation.containing_relation_members %></ul>
+      <ul><%= render :partial => "containing_relation", :collection => relation.containing_relation_members.uniq %></ul>
     <% end %>
   </div>
 <% end %>
index fd419586fb1749c8ba4aae9ac0e0fd963ddf1858..aff405dde2b780f5ae8cac5fcfdb9dcc4f0f3162 100644 (file)
@@ -28,7 +28,7 @@
     <% unless way.containing_relation_members.empty? %>
       <h4><%= t'browse.part_of' %></h4>
       <ul>
-        <%= render :partial => "containing_relation", :collection => way.containing_relation_members %>
+        <%= render :partial => "containing_relation", :collection => way.containing_relation_members.uniq %>
       </ul>
     <% end %>
   </div>