2011-02-11 02:53:41 -05:00
|
|
|
<%# The container tag
|
|
|
|
- available local variables
|
|
|
|
current_page: the page number of currently displayed page
|
|
|
|
num_pages: total number of pages
|
|
|
|
per_page: number of items to fetch per page
|
|
|
|
remote: data-remote
|
2011-02-16 09:24:31 -05:00
|
|
|
paginator: the paginator that renders the pagination tags inside
|
2011-02-08 16:59:27 -05:00
|
|
|
-%>
|
2011-02-16 09:24:31 -05:00
|
|
|
<% paginator.render do -%>
|
2011-02-15 16:48:35 -05:00
|
|
|
<nav class='pagination'>
|
|
|
|
<%= current_page > 1 ? prev_link_tag : prev_span_tag %>
|
|
|
|
<% each_page do |page| -%>
|
|
|
|
<% if page.current? -%>
|
|
|
|
<%= current_page_tag %>
|
|
|
|
<% elsif page.left_outer? || page.right_outer? || page.inside_window? -%>
|
2011-02-15 17:21:56 -05:00
|
|
|
<% if page.first? -%>
|
|
|
|
<%= first_page_link_tag %>
|
|
|
|
<% elsif page.last? -%>
|
|
|
|
<%= last_page_link_tag %>
|
|
|
|
<% else -%>
|
|
|
|
<%= page_link_tag %>
|
|
|
|
<% end -%>
|
2011-02-15 16:48:35 -05:00
|
|
|
<% elsif !page.was_truncated? -%>
|
|
|
|
<%= truncated_span_tag %>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
|
|
<%= num_pages > current_page ? next_link_tag : next_span_tag %>
|
|
|
|
</nav>
|
|
|
|
<% end -%>
|