From b27fb1236aa6ce8e638eb8c28041e6e2c33e1800 Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Sat, 3 Jan 2026 15:13:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BD=D1=83=D0=BC=D0=B5=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=20=D0=B2=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Вместо текста 'X / Y' теперь кликабельные цифры страниц - Показывается до 10 страниц (±5 от текущей) - Текущая страница выделена (active) - Умная логика: если на странице 15, показывает 10-20 - Все параметры фильтров сохраняются при клике на номер страницы --- .../templates/customers/customer_list.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/myproject/customers/templates/customers/customer_list.html b/myproject/customers/templates/customers/customer_list.html index 35cc1fe..8f7bcb8 100644 --- a/myproject/customers/templates/customers/customer_list.html +++ b/myproject/customers/templates/customers/customer_list.html @@ -153,9 +153,22 @@ {% endif %} -
  • - {{ page_obj.number }} / {{ page_obj.paginator.num_pages }} -
  • + {# Цифры страниц: показываем до 10 страниц #} + {% with start_page=page_obj.number|add:"-5" end_page=page_obj.number|add:"5" %} + {% for num in page_obj.paginator.page_range %} + {% if num >= start_page|default:1 and num <= end_page and num <= page_obj.paginator.num_pages %} + {% if num == page_obj.number %} +
  • + {{ num }} +
  • + {% else %} +
  • + {{ num }} +
  • + {% endif %} + {% endif %} + {% endfor %} + {% endwith %} {% if page_obj.has_next %}