From: Tom Hughes Date: Tue, 25 Mar 2025 19:15:47 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/4872' X-Git-Tag: live~120 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a232ed0579a0351a5ef4643f3000c471057b7e17?hp=34c9aa53fed200a8b61fec3580e770630a14f7bb Merge remote-tracking branch 'upstream/pull/4872' --- diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index 482503e8a..5909706fb 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -79,18 +79,6 @@ module BrowseHelper "nofollow" if object.tags.empty? end - def type_and_paginated_count(type, pages, selected_page = pages.current_page) - if pages.page_count == 1 - t ".#{type.pluralize}", - :count => pages.item_count - else - t ".#{type.pluralize}_paginated", - :x => selected_page.first_item, - :y => selected_page.last_item, - :count => pages.item_count - end - end - def sidebar_classic_pagination(pages, page_param) max_width_for_default_padding = 35 diff --git a/app/views/changesets/_paging_nav.html.erb b/app/views/changesets/_paging_nav.html.erb index 058738222..9fa23f670 100644 --- a/app/views/changesets/_paging_nav.html.erb +++ b/app/views/changesets/_paging_nav.html.erb @@ -1,8 +1,25 @@ -

<%= type_and_paginated_count(type, pages) %>

-<% if pages.page_count > 1 %> +<% if pages.page_count == 1 %> +

+ <%= t ".#{type.pluralize}_title" %> + + <%= pages.item_count %> + +

+<% elsif pages.page_count > 1 %> +

+ <%= t ".#{type.pluralize}_title" %> + + <%= t ".range", :x => pages.current_page.first_item, + :y => pages.current_page.last_item, + :count => pages.item_count %> + +

+ <%= sidebar_classic_pagination(pages, "#{type}_page") do |page| { - :title => type_and_paginated_count(type, pages, page), + :title => t(".#{type.pluralize}_paginated", :x => page.first_item, + :y => page.last_item, + :count => pages.item_count), :data => { :turbo => "true" } } end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 230d9242c..aba37e934 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -522,12 +522,13 @@ en: changesetxml: "Changeset XML" osmchangexml: "osmChange XML" paging_nav: - nodes: "Nodes (%{count})" + nodes_title: "Nodes" nodes_paginated: "Nodes (%{x}-%{y} of %{count})" - ways: "Ways (%{count})" + ways_title: "Ways" ways_paginated: "Ways (%{x}-%{y} of %{count})" - relations: "Relations (%{count})" + relations_title: "Relations" relations_paginated: "Relations (%{x}-%{y} of %{count})" + range: "%{x}-%{y} of %{count}" not_found_message: sorry: "Sorry, changeset #%{id} could not be found." timeout: