Files
ACORE/templates/partials/pagination.html
T
lokses 5e4528b23f Портал: страницы на реальных данных, детальные страницы, утилиты
- core/views: dashboard/databases/it-support/structure на живых данных;
  детальная сотрудника (/employees/<pk>/) с PII-гейтингом (staff/сам/
  руководитель), детальная аптеки, дислокация, профиль, показания счётчиков
- core/utils: crypto (Fernet-обёртка), pagination; партиалы пагинации и
  AD-вкладок
- шаблоны страниц обновлены под реальные контексты
- тесты (21): смоук всех страниц, PII-доступ сотрудника, дерево справочников

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 17:33:48 +03:00

41 lines
3.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% comment %}
Панель пагінації. Обов'язкові змінні контексту:
page — django.core.paginator.Page (core.utils.pagination.paginate)
base_url — шлях сторінки (напр. "/employees/")
page_param, size_param — імена GET-параметрів (напр. "page", "per_page")
Необов'язково:
item_label — назва сутностей у підписі ("співробітників", "заявок"...)
{% endcomment %}
<div style="padding:0.875rem 1.5rem; border-top:1px solid var(--color-border); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:0.75rem;">
<span style="font-size:0.8125rem; color:var(--color-muted-foreground);">
{% if page.paginator.count %}
Показано {{ page.start_index }}–{{ page.end_index }} з {{ page.paginator.count }}{% if item_label %} {{ item_label }}{% endif %}
{% else %}
Немає записів
{% endif %}
</span>
<div style="display:flex; align-items:center; gap:1rem; flex-wrap:wrap;">
<div style="display:flex; align-items:center; gap:0.375rem;">
<span style="font-size:0.8125rem; color:var(--color-muted-foreground); white-space:nowrap;">На сторінці:</span>
<select class="input" style="font-size:0.8125rem; padding:0.3rem 0.5rem; height:auto; width:auto;"
onchange="paginationNav('{{ base_url }}', '{{ page_param }}', '{{ size_param }}', 1, this.value)">
<option value="10" {% if page.paginator.per_page == 10 %}selected{% endif %}>10</option>
<option value="15" {% if page.paginator.per_page == 15 %}selected{% endif %}>15</option>
<option value="25" {% if page.paginator.per_page == 25 %}selected{% endif %}>25</option>
<option value="100" {% if page.paginator.per_page == 100 %}selected{% endif %}>100</option>
</select>
</div>
<div style="display:flex; align-items:center; gap:0.375rem;">
<button type="button" class="btn btn-secondary" style="padding:0.375rem 0.75rem; font-size:0.8125rem;"
{% if page.has_previous %}
onclick="paginationNav('{{ base_url }}', '{{ page_param }}', '{{ size_param }}', {{ page.previous_page_number }}, {{ page.paginator.per_page }})"
{% else %}disabled{% endif %}>← Попередня</button>
<span style="font-size:0.8125rem; color:var(--color-muted-foreground); white-space:nowrap;">Стор. {{ page.number }} з {{ page.paginator.num_pages }}</span>
<button type="button" class="btn btn-secondary" style="padding:0.375rem 0.75rem; font-size:0.8125rem;"
{% if page.has_next %}
onclick="paginationNav('{{ base_url }}', '{{ page_param }}', '{{ size_param }}', {{ page.next_page_number }}, {{ page.paginator.per_page }})"
{% else %}disabled{% endif %}>Наступна →</button>
</div>
</div>
</div>