1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/app/views/kaminari/_paginator.html.erb
Akira Matsuda 4beef97cea fixes #28 a page can be both current and first or last
merge _current_page, _first_page_link, _last_page_link and _page_link into one _page partial
2011-02-25 10:35:21 +09:00

21 lines
763 B
Text

<%# 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
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination">
<%= current_page > 1 ? prev_link_tag : prev_span_tag %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= truncated_span_tag %>
<% end -%>
<% end -%>
<%= num_pages > current_page ? next_link_tag : next_span_tag %>
</nav>
<% end -%>