Untitled
4 months ago in HTML
<!-- Centered Pagination Controls -->
<div class="d-flex justify-content-center">
<nav aria-label="Page navigation">
<ul class="pagination">
{% if products.has_previous %}
<li class="page-item">
<a class="page-link" href="?page=1" aria-label="First">
<span aria-hidden="true">&laquo;&laquo;</span>
</a>
</li>
<li class="page-item">
<a class="page-link" href="?page={{ products.previous_page_number }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link">&laquo;&laquo;</span>
</li>
<li class="page-item disabled">
<span class="page-link">&laquo;</span>
</li>
{% endif %}
<li class="page-item disabled">
<span class="page-link">Page {{ products.number }} of {{ products.paginator.num_pages }}</span>
</li>
{% if products.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ products.next_page_number }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
<li class="page-item">
<a class="page-link" href="?page={{ products.paginator.num_pages }}" aria-label="Last">
<span aria-hidden="true">&raquo;&raquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link">&raquo;</span>
</li>
<li class="page-item disabled">
<span class="page-link">&raquo;&raquo;</span>
</li>
{% endif %}
</ul>
</nav>
</div>