2017-04-20 13:07:22 -04:00
|
|
|
{% load helpers %}
|
2023-07-29 03:30:25 +07:00
|
|
|
{% load i18n %}
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2024-01-17 16:25:42 -05:00
|
|
|
{% if page %}
|
|
|
|
<div class="d-flex justify-content-between align-items-center border-top p-2">
|
|
|
|
|
|
|
|
{# Pages carousel #}
|
2017-04-20 13:07:22 -04:00
|
|
|
{% if paginator.num_pages > 1 %}
|
2024-01-17 16:25:42 -05:00
|
|
|
<nav aria-label="{% trans "Page selection" %}">
|
|
|
|
<ul class="pagination mb-0">
|
|
|
|
|
|
|
|
{# Previous page #}
|
|
|
|
{% if page.has_previous %}
|
|
|
|
<li class="page-item">
|
|
|
|
{% if htmx %}
|
|
|
|
<a href="#"
|
|
|
|
hx-get="{{ table.htmx_url }}{% querystring request page=page.previous_page_number %}"
|
|
|
|
hx-target="closest .htmx-container"
|
|
|
|
{% if not table.embedded %}hx-push-url="true"{% endif %}
|
|
|
|
class="page-link"
|
|
|
|
>
|
|
|
|
<i class="mdi mdi-chevron-left"></i>
|
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% querystring request page=page.previous_page_number %}" class="page-link">
|
|
|
|
<i class="mdi mdi-chevron-left"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
2021-12-14 20:53:24 -05:00
|
|
|
{% endif %}
|
2024-01-17 16:25:42 -05:00
|
|
|
{# /Previous page #}
|
|
|
|
|
|
|
|
{# Page numbers #}
|
|
|
|
{% for p in page.smart_pages %}
|
|
|
|
<li class="page-item{% if page.number == p %} active" aria-current="page{% endif %}">
|
|
|
|
{% if p and htmx %}
|
|
|
|
<a href="#"
|
|
|
|
hx-get="{{ table.htmx_url }}{% querystring request page=p %}"
|
|
|
|
hx-target="closest .htmx-container"
|
|
|
|
{% if not table.embedded %}hx-push-url="true"{% endif %}
|
|
|
|
class="page-link"
|
|
|
|
>
|
|
|
|
{{ p }}
|
|
|
|
</a>
|
|
|
|
{% elif p %}
|
2024-01-23 10:30:23 -05:00
|
|
|
<a href="{% querystring request page=p %}" class="page-link {% if page.number == p %} active{% endif %}">
|
2024-01-17 16:25:42 -05:00
|
|
|
{{ p }}
|
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<span class="page-link" disabled>…</span>
|
|
|
|
{% endif %}
|
2021-12-15 09:46:59 -05:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
2024-01-17 16:25:42 -05:00
|
|
|
{# /Page numbers #}
|
|
|
|
|
|
|
|
{# Next page #}
|
|
|
|
{% if page.has_next %}
|
|
|
|
<li class="page-item">
|
|
|
|
{% if htmx %}
|
|
|
|
<a href="#"
|
|
|
|
hx-get="{{ table.htmx_url }}{% querystring request page=page.next_page_number %}"
|
|
|
|
hx-target="closest .htmx-container"
|
|
|
|
{% if not table.embedded %}hx-push-url="true"{% endif %}
|
|
|
|
class="page-link"
|
|
|
|
>
|
|
|
|
<i class="mdi mdi-chevron-right"></i>
|
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% querystring request page=page.next_page_number %}" class="page-link">
|
|
|
|
<i class="mdi mdi-chevron-right"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{# /Next page #}
|
|
|
|
|
2021-12-15 09:46:59 -05:00
|
|
|
</ul>
|
2024-01-17 16:25:42 -05:00
|
|
|
</nav>
|
2017-05-16 16:19:55 -04:00
|
|
|
{% endif %}
|
2024-01-17 16:25:42 -05:00
|
|
|
{# /Pages carousel #}
|
|
|
|
|
|
|
|
{# Showing #}
|
|
|
|
<small class="text-end text-muted">
|
|
|
|
{% blocktrans trimmed with start=page.start_index end=page.end_index total=page.paginator.count %}
|
|
|
|
Showing {{ start }}-{{ end }} of {{ total }}
|
|
|
|
{% endblocktrans %}
|
|
|
|
</small>
|
|
|
|
{# /Showing #}
|
|
|
|
|
|
|
|
{# Pagination options #}
|
|
|
|
<nav class="text-end" aria-label="{% trans "Pagination options" %}">
|
|
|
|
{% if page %}
|
|
|
|
<div class="dropdown">
|
|
|
|
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
|
|
|
{% trans "Per Page" %}
|
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu">
|
|
|
|
{% for n in page.paginator.get_page_lengths %}
|
|
|
|
{% if htmx %}
|
|
|
|
<a href="#"
|
|
|
|
hx-get="{{ table.htmx_url }}{% querystring request per_page=n %}"
|
|
|
|
hx-target="closest .htmx-container"
|
|
|
|
{% if not table.embedded %}hx-push-url="true"{% endif %}
|
|
|
|
class="dropdown-item"
|
|
|
|
>{{ n }}</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% querystring request per_page=n %}" class="dropdown-item">{{ n }}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</nav>
|
|
|
|
{# /Pagination options #}
|
|
|
|
|
2021-12-14 20:53:24 -05:00
|
|
|
</div>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% endif %}
|