From 31f93077f96c9f5d04f2c9ff17ab4a4a662f2579 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 3 Jun 2024 14:51:47 +0300 Subject: [PATCH] Show changeset element counts using badges --- app/views/changesets/_paging_nav.html.erb | 14 ++++++++++---- config/locales/en.yml | 7 ++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/views/changesets/_paging_nav.html.erb b/app/views/changesets/_paging_nav.html.erb index 47b0c7590..9fa23f670 100644 --- a/app/views/changesets/_paging_nav.html.erb +++ b/app/views/changesets/_paging_nav.html.erb @@ -1,12 +1,18 @@ <% if pages.page_count == 1 %>

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

<% elsif pages.page_count > 1 %>

- <%= t ".#{type.pluralize}_paginated", :x => pages.current_page.first_item, - :y => pages.current_page.last_item, - :count => pages.item_count %> + <%= 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| diff --git a/config/locales/en.yml b/config/locales/en.yml index 32b0bc6bc..2fffdabdd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -523,12 +523,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: -- 2.39.5