]> git.openstreetmap.org Git - rails.git/blob - app/views/trace/_trace_paging_nav.rhtml
Make next and previous links on user/XXX/traces work. Fixes #501.
[rails.git] / app / views / trace / _trace_paging_nav.rhtml
1 <%
2   range_start = ((@page - 1) * @traces_per_page) + 1
3   range_end = (@page==@max_page ? @max_trace : (@page * @traces_per_page))
4 %>
5
6 Showing page 
7 <%= @page %> (<%= range_start %><% 
8 if (@max_trace != range_start) # if more than 1 trace on page 
9   %>-<%= range_end %><% 
10 end %>
11 of <%= @max_trace %>)
12
13 <% if @page > 1 %>
14   | <%= link_to 'previous page', {:controller => 'trace', :display_name => @display_name, :action => @paging_action, :page => @page-1}, {:title => 'previous page'} %>
15 <% end %>
16
17 <% if @page < @max_page %>
18   | <%= link_to 'next page', {:controller => 'trace', :display_name => @display_name, :action => @paging_action, :page => @page+1}, {:title => 'next page'} %>
19 <% end %>