accounts/templates/include/paginator.html
2024-08-03 16:52:09 +03:30

35 lines
1.9 KiB
HTML

{% load tags %}
<nav class="d-flex justify-content-center" aria-label="Page navigation example">
<ul class="pagination">
{% if is_paginated %}
{% get_proper_elided_page_range paginator page_obj.number as page_range %}
{% for i in page_range %}
{% if page_obj.number == i %}
<li class="page-item"><span class="page-link"><strong>( {{ i }} )</strong></span></li>
{% elif i == '…' %}
<li class="page-item"><span class="page-link">{{ i }}</span></li>
{% else %}
<li class="page-item"><a class="page-link" href="?page={{ i }}{% for fil, fil_value in filter.data.items %}{% if fil != 'page' %}&{{fil}}={{fil_value}}{% endif %}{% endfor %}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% endif %}
<li class="p-2"><span class="fw-bolder text-decoration-underline">{{ paginator.count }}</span> داده یافت شد.</li>
</ul>
</nav>
{# <nav aria-label="Page navigation example">#}
{# <ul class="pagination">#}
{# {% if is_paginated %}#}
{##}
{# <li class="page-item"><span class="page-link">{{ page_obj.number }} از {{ page_obj.paginator.num_pages }}</span></li>#}
{# <li class="page-item"><span class="page-link">{{ page_obj.number }} از {{ page_obj.paginator.num_pages }}</span></li>#}
{# {% elif i > page_obj.number|add:'-5' and i < page_obj.number|add:'5' %}#}
{# <li class="page-item"><a class="page-link" href="?page={{ i }}{{ query_string }}">{{ i }}</a>#}
{# </li>#}
{# {% endif %}#}
{##}
{# {% endif %}#}
{# </ul>#}
{# </nav>#}