Created
April 13, 2017 20:19
-
-
Save AsaK/7f47510b4386be57ed9761c021ea6e82 to your computer and use it in GitHub Desktop.
Django Template 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 page_obj.has_previous %} | |
<li class="page-item"> | |
<a class="page-link" href="?page={{ page_obj.previus_page_number }}">Anterior</a> | |
</li> | |
{% endif %} | |
{% for page in page_obj.paginator.page_range %} | |
{% if page_obj.number == page %} | |
<li class="page-item active"> | |
<a class="page-link">{{ page }}</a> | |
</li> | |
{% else %} | |
<li class="page-item"> | |
<a class="page-link" href="?page={{ page }}">{{ page }}</a> | |
</li> | |
{% endif %} | |
{% endfor %} | |
{% if page_obj.has_next %} | |
<li class="page-item"> | |
<a class="page-link" href="?page={{ page_obj.next_page_number }}">Proxima</a> | |
</li> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment