Skip to content

Commit

Permalink
Show only one icon for way node group
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Nov 25, 2024
1 parent 9cd4bcb commit 5ad3bad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ img.trace_image {
.node::before,
.way::before,
.relation::before {
position: absolute;
display: inline-block;
width: 25px;
margin-left: -25px;
Expand Down
8 changes: 8 additions & 0 deletions app/helpers/browse_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def element_single_current_link(type, object)
end
end

def element_single_current_link_without_icon(type, object)
link_to object, { :title => element_title(object), :rel => (link_follow(object) if type == "node") } do
element_strikethrough object do
printable_element_name object
end
end
end

def element_list_item(type, object, &block)
tag.li :class => element_class(type, object), :title => element_title(object) do
element_strikethrough object, &block
Expand Down
11 changes: 6 additions & 5 deletions app/views/browse/_way.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
<summary><%= t ".nodes_count", :count => way.way_nodes.count %></summary>
<ul class="list-unstyled">
<% group_way_nodes(way).each do |node_group| %>
<li>
<%= tag.li :class => element_class("node", node_group[:nodes].first) do %>
<div>
<% node_group[:nodes].each do |node| %>
<%= element_single_current_link "node", node %>
<% node_group[:nodes].each_with_index do |node, i| %>
<%= " · " if i.positive? %>
<%= element_single_current_link_without_icon "node", node %>
<% end %>
</div>
<% if node_group[:related_ways].size.positive? %>
<%= tag.details :class => "ms-4", :open => node_group[:open] do %>
<%= tag.details :open => node_group[:open] do %>
<summary><%= t ".also_part_of_ways", :count => node_group[:related_ways].size %></summary>
<ul class="list-unstyled">
<% node_group[:related_ways].each do |related_way| %>
Expand All @@ -44,7 +45,7 @@
</ul>
<% end %>
<% end %>
</li>
<% end %>
<% end %>
</ul>
</details>
Expand Down

0 comments on commit 5ad3bad

Please sign in to comment.