Skip to content

Commit

Permalink
Add oldest/newest links to shared pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Jan 6, 2025
1 parent e4aafce commit efd5e9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/views/shared/_pagination.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<% translation_scope ||= "shared.pagination.#{controller.controller_name}" %>
<nav>
<ul class="pagination">
<%= pagination_item(newer_id && @params.merge(:before => nil, :after => nil)) do %>
<%= previous_page_svg_tag :class => "flex-shrink-0 d-none d-sm-block", :count => 2 %>
<%= t :newest, :scope => translation_scope %>
<% end %>
<%= pagination_item(newer_id && @params.merge(:before => nil, :after => newer_id)) do %>
<%= previous_page_svg_tag :class => "flex-shrink-0 d-none d-sm-block" %>
<%= t :newer, :scope => translation_scope %>
Expand All @@ -11,6 +15,10 @@
<%= t :older, :scope => translation_scope %>
<%= next_page_svg_tag :class => "flex-shrink-0 d-none d-sm-block" %>
<% end %>
<%= pagination_item(older_id && @params.merge(:before => nil, :after => 0)) do %>
<%= t :oldest, :scope => translation_scope %>
<%= next_page_svg_tag :class => "flex-shrink-0 d-none d-sm-block", :count => 2 %>
<% end %>
</ul>
</nav>

Expand Down
12 changes: 12 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1932,21 +1932,33 @@ en:
diary_comments:
older: Older Comments
newer: Newer Comments
oldest: Oldest Comments
newest: Newest Comments
diary_entries:
older: Older Entries
newer: Newer Entries
oldest: Oldest Entries
newest: Newest Entries
issues:
older: Older Issues
newer: Newer Issues
oldest: Oldest Issues
newest: Newest Issues
traces:
older: Older Traces
newer: Newer Traces
oldest: Oldest Traces
newest: Newest Traces
user_blocks:
older: Older Blocks
newer: Newer Blocks
oldest: Oldest Blocks
newest: Newest Blocks
users:
older: Older Users
newer: Newer Users
oldest: Oldest Users
newest: Newest Users
site:
about:
heading_html: "%{copyright}OpenStreetMap %{br} contributors"
Expand Down

0 comments on commit efd5e9a

Please sign in to comment.