index and paginator added

This commit is contained in:
Francisco Rodriguez
2022-11-27 11:05:35 -07:00
parent ac180683c3
commit 76465e348b
6 changed files with 186 additions and 4 deletions

38
Templates/paginator.html Normal file
View 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">&laquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&laquo;</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">&raquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&raquo;</span>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
</div>