X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d07277efba0c0069705bbefa68f2624a9c6c9ff0..698a49077c67297cd8ea7b370d1ac2298ee5d9f6:/app/views/trace/_trace_paging_nav.rhtml diff --git a/app/views/trace/_trace_paging_nav.rhtml b/app/views/trace/_trace_paging_nav.rhtml index 4811336ab..9ac80d4cd 100644 --- a/app/views/trace/_trace_paging_nav.rhtml +++ b/app/views/trace/_trace_paging_nav.rhtml @@ -1,19 +1,12 @@ -<% - range_start = ((@page - 1) * @traces_per_page) + 1 - range_end = (@page==@max_page ? @max_trace : (@page * @traces_per_page)) -%> - -Showing page -<%= @page %> (<%= range_start %><% -if (@max_trace != range_start) # if more than 1 trace on page - %>-<%= range_end %><% -end %> -of <%= @max_trace %>) - -<% if @page > 1 %> - | <%= link_to 'previous page', {:controller => 'trace', :action => @paging_action, :page => @page-1}, {:title => 'previous page'} %> -<% end %> - -<% if @page < @max_page %> - | <%= link_to 'next page', {:controller => 'trace', :action => @paging_action, :page => @page+1}, {:title => 'next page'} %> -<% end %> +<% current_page = @trace_pages.current_page %> + +<%= t'trace.trace_paging_nav.showing' %> +<%= current_page.number %> (<%= current_page.first_item %><% +if (current_page.first_item < current_page.last_item) # if more than 1 trace on page + %>-<%= current_page.last_item %><% +end %> +<%= t'trace.trace_paging_nav.of' %> <%= @trace_pages.item_count %>) + +<% if @trace_pages.page_count > 1 %> + | <%= pagination_links_each(@trace_pages, {}) { |n| link_to_page(n) } %> +<% end %>