index and paginator added
This commit is contained in:
38
Templates/paginator.html
Normal file
38
Templates/paginator.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% if timbres.has_other_pages %}
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if timbres.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ timbres.previous_page_number }}" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link" aria-hidden="true">«</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% for p in timbres.paginator.page_range %}
|
||||
{% if timbres.number == p %}
|
||||
<li class="page-item"><a class="page-link" style="color: red;" href="#">{{ p }}</a></li>
|
||||
{% else %}
|
||||
<li class="page-item"><a class="page-link" href="?page={{ p }}">{{ p }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if timbres.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ timbres.next_page_number }}" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link" aria-hidden="true">»</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
Reference in New Issue
Block a user