Created
January 1, 2015 20:32
-
-
Save marc-gist/a7ce36589f502eede4d9 to your computer and use it in GitHub Desktop.
bootstrap 3 ListView Pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if is_paginated %} | |
<ul class="pagination pagination-centered"> | |
{% if page_obj.has_previous %} | |
<li><a href="?page=1"><<</a></li> | |
<li><a href="?page={{ page_obj.previous_page_number }}"><</a></li> | |
{% endif %} | |
{% for i in paginator.page_range %} | |
<li {% if page_obj.number == i %} class="active" {% endif %}><a href="?page={{i}}">{{i}}</a></li> | |
{% endfor %} | |
{% if page_obj.has_next %} | |
<li><a href="?page={{ page_obj.next_page_number }}">></a></li> | |
<li><a href="?page={{ page_obj.paginator.num_pages }}">>></a></li> | |
{% endif %} | |
</ul> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment