mybuddy/babyblotter/templates/babyblotter/paginator.html

32 lines
1.3 KiB
HTML
Raw Normal View History

2017-09-10 21:02:57 +00:00
{% if is_paginated %}
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
<i class="icon icon-chevron-left" aria-hidden="true"></i>
2017-09-10 21:02:57 +00:00
<span class="sr-only">Previous</span>
</a>
</li>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if num > page_obj.number|add:"-3" and num < page_obj.number|add:"3" %}
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
</li>
{% endif %}
2017-09-10 21:02:57 +00:00
{% endfor %}
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.next_page_number }}" aria-label="Next">
<i class="icon icon-chevron-right" aria-hidden="true"></i>
2017-09-10 21:02:57 +00:00
<span class="sr-only">Next</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}