]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/_node.html.erb
Move browse section wrapper out of branching in element partials
[rails.git] / app / views / browse / _node.html.erb
1 <%= tag.div :class => ["browse-section", { "text-body-secondary" => node.redacted? && params[:show_redactions] }] do %>
2   <% if node.redacted? && !params[:show_redactions] %>
3     <%= t "browse.redacted.message_html",
4           :type => t("browse.redacted.type.node"),
5           :version => node.version,
6           :redaction_link => link_to(t("browse.redacted.redaction",
7                                        :id => node.redaction.id), node.redaction) %>
8   <% else %>
9     <%= render :partial => "browse/common_details", :object => node %>
10
11     <% unless node.ways.empty? and node.containing_relation_members.empty? %>
12       <h4><%= t "browse.part_of" %></h4>
13       <% unless node.ways.empty? %>
14         <details <%= "open" if node.ways.count < 10 %>>
15           <summary><%= t "browse.part_of_ways", :count => node.ways.uniq.count %></summary>
16           <ul class="list-unstyled browse-element-list">
17             <% node.ways.uniq.each do |way| %>
18               <%= element_list_item "way", way do %>
19                 <%= element_single_current_link "way", way %>
20               <% end %>
21             <% end %>
22           </ul>
23         </details>
24       <% end %>
25       <% unless node.containing_relation_members.empty? %>
26         <details <%= "open" if node.containing_relation_members.count < 10 %>>
27           <summary><%= t "browse.part_of_relations", :count => node.containing_relation_members.uniq.count %></summary>
28           <ul class="list-unstyled browse-element-list">
29             <%= render :partial => "browse/containing_relation", :collection => node.containing_relation_members.uniq %>
30           </ul>
31         </details>
32       <% end %>
33     <% end %>
34   <% end %>
35 <% end %>