style pagination

This commit is contained in:
jomo
2014-09-22 05:47:58 +02:00
parent 05a3f67c02
commit 5a7e6cbe85
2 changed files with 32 additions and 0 deletions

View File

@@ -917,4 +917,15 @@ img {
font-style: italic;
margin-top: 5em;
}
}
nav.pagination {
font-size: 0;
margin-top: 60px;
span {
display: inline-block;
font-size: 20px;
padding: 0 5px;
}
}

View File

@@ -0,0 +1,21 @@
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
total_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">
<%= first_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= last_page_tag unless current_page.last? %>
</nav>
<% end -%>