mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
4beef97cea
merge _current_page, _first_page_link, _last_page_link and _page_link into one _page partial
21 lines
763 B
Text
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 -%>
|