Skip to content

Commit

Permalink
Show changeset element counts using badges
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Sep 18, 2024
1 parent c9211b0 commit ad5fa6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 10 additions & 4 deletions app/views/changesets/_paging_nav.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<% if pages.page_count == 1 %>
<h4 class="fs-5">
<%= t ".#{type.pluralize}", :count => pages.item_count %>
<%= t ".#{type.pluralize}_title" %>
<span class="badge count-number">
<%= pages.item_count %>
</span>
</h4>
<% elsif pages.page_count > 1 %>
<h4 class="fs-5">
<%= t ".#{type.pluralize}_paginated", :x => pages.current_page.first_item,
:y => pages.current_page.last_item,
:count => pages.item_count %>
<%= t ".#{type.pluralize}_title" %>
<span class="badge count-number">
<%= t ".range", :x => pages.current_page.first_item,
:y => pages.current_page.last_item,
:count => pages.item_count %>
</span>
</h4>

<%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
Expand Down
7 changes: 4 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,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}"
timeout:
sorry: "Sorry, the list of changesets you requested took too long to retrieve."
dashboards:
Expand Down

0 comments on commit ad5fa6f

Please sign in to comment.