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