From a3f1f005a5290cf0597a90c7eed96e842a780491 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sun, 8 Feb 2026 14:32:27 +0100 Subject: [PATCH] Use tag helper for dynamic attributes --- app/views/browse/_node.html.erb | 8 ++++---- app/views/browse/_relation.html.erb | 8 ++++---- app/views/browse/_way.html.erb | 8 ++++---- app/views/layouts/_markers.html.erb | 2 +- app/views/profiles/locations/show.html.erb | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/views/browse/_node.html.erb b/app/views/browse/_node.html.erb index d063c2b7f..cc3804da5 100644 --- a/app/views/browse/_node.html.erb +++ b/app/views/browse/_node.html.erb @@ -12,7 +12,7 @@ <% unless node.ways.empty? and node.containing_relation_members.empty? %>

<%= t "browse.part_of" %>

<% unless node.ways.empty? %> -
> + <%= tag.details :open => node.ways.count < 10 do %> <%= t "browse.part_of_ways", :count => node.ways.uniq.count %> -
+ <% end %> <% end %> <% unless node.containing_relation_members.empty? %> -
> + <%= tag.details :open => node.containing_relation_members.count < 10 do %> <%= t "browse.part_of_relations", :count => node.containing_relation_members.uniq.count %> -
+ <% end %> <% end %> <% end %> <% end %> diff --git a/app/views/browse/_relation.html.erb b/app/views/browse/_relation.html.erb index 405493de1..b09316fd2 100644 --- a/app/views/browse/_relation.html.erb +++ b/app/views/browse/_relation.html.erb @@ -11,17 +11,17 @@ <% unless relation.containing_relation_members.empty? %>

<%= t "browse.part_of" %>

-
> + <%= tag.details :open => relation.containing_relation_members.count < 10 do %> <%= t "browse.part_of_relations", :count => relation.containing_relation_members.uniq.count %> -
+ <% end %> <% end %> <% unless relation.relation_members.empty? %>

<%= t ".members" %>

-
> + <%= tag.details :open => relation.relation_members.count < 10 do %> <%= t ".members_count", :count => relation.relation_members.count %> <% if relation.relation_members.count >= 10 %> <% if relation.is_a?(OldRelation) %> @@ -43,7 +43,7 @@ <%= render :partial => "browse/relation_member", :collection => relation.relation_members %> <% end %> -
+ <% end %> <% end %> <% end %> <% end %> diff --git a/app/views/browse/_way.html.erb b/app/views/browse/_way.html.erb index cdb0676bc..4a0022cf6 100644 --- a/app/views/browse/_way.html.erb +++ b/app/views/browse/_way.html.erb @@ -11,17 +11,17 @@ <% unless way.containing_relation_members.empty? %>

<%= t "browse.part_of" %>

-
> + <%= tag.details :open => way.containing_relation_members.count < 10 do %> <%= t "browse.part_of_relations", :count => way.containing_relation_members.uniq.count %> -
+ <% end %> <% end %> <% unless way.way_nodes.empty? %>

<%= t ".nodes" %>

-
> + <%= tag.details :open => way.way_nodes.count < 10 do %> <%= t ".nodes_count", :count => way.way_nodes.count %> -
+ <% end %> <% end %> <% end %> <% end %> diff --git a/app/views/layouts/_markers.html.erb b/app/views/layouts/_markers.html.erb index 71aba1820..98c34231f 100644 --- a/app/views/layouts/_markers.html.erb +++ b/app/views/layouts/_markers.html.erb @@ -24,7 +24,7 @@ } %> <% types.filter { |type| markers[type] }.each do |type| %> - /> + <%= tag.path :id => "#{type}-path", :attributes => markers[type] %> diff --git a/app/views/profiles/locations/show.html.erb b/app/views/profiles/locations/show.html.erb index 253567017..93682535a 100644 --- a/app/views/profiles/locations/show.html.erb +++ b/app/views/profiles/locations/show.html.erb @@ -17,9 +17,9 @@ <%= f.text_field :home_lat, :wrapper_class => "col-sm-4 d-flex flex-column", :class => "mt-auto", :id => "home_lat" %> <%= f.text_field :home_lon, :wrapper_class => "col-sm-4 d-flex flex-column", :class => "mt-auto", :id => "home_lon" %>
- - - + <%= button_tag t(".show"), :type => "button", :id => "home_show", :class => "btn btn-outline-primary", :hidden => !current_user.home_location?, :disabled => true %> + <%= button_tag t(".delete"), :type => "button", :id => "home_delete", :class => "btn btn-outline-primary", :hidden => !current_user.home_location? %> + <%= button_tag t(".undelete"), :type => "button", :id => "home_undelete", :class => "btn btn-outline-primary", :hidden => true %>
<%= f.text_field :home_location_name, :wrapper_class => "my-2 col-sm-4 pe-3", :class => "mt-auto", :id => "home_location_name" %> -- 2.39.5