-<% if @page > 1 %>
- | <%= link_to 'previous page', {:controller => 'trace', :display_name => @display_name, :action => @paging_action, :page => @page-1}, {:title => 'previous page'} %>
-<% end %>
-
-<% if @page < @max_page %>
- | <%= link_to 'next page', {:controller => 'trace', :display_name => @display_name, :action => @paging_action, :page => @page+1}, {:title => 'next page'} %>
+<% if @trace_pages.page_count > 1 %>
+ | <%= pagination_links_each(@trace_pages, {}) { |n| link_to_page(n) } %>