From c01c615cb22b6c5c9fee1f7177378d944fc128dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=9D=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Wed, 3 Dec 2025 07:44:25 +0300 Subject: [PATCH] =?UTF-8?q?fix(requests):=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B0=D1=82=20?= =?UTF-8?q?=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=87=D0=BD=D0=BE=D0=BC?= =?UTF-8?q?=20=D0=B2=D0=B8=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Проблема: API возвращает даты как строки ISO, фильтр date не работал Решение: используется slice для извлечения даты и времени из ISO строк - date_from/date_to: slice:":10" для YYYY-MM-DD - created_at: slice:":10" для даты, slice:"11:16" для времени - Добавлены проверки на существование значений --- .../static/css/components/request-list.css | 48 +++++++++++++++++++ .../requests_app/request_list_full.html | 47 ++++++++++++++++-- 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/backend/static/css/components/request-list.css b/backend/static/css/components/request-list.css index 6dd66de9..6d80a8e1 100644 --- a/backend/static/css/components/request-list.css +++ b/backend/static/css/components/request-list.css @@ -12,6 +12,47 @@ padding: 0; } +/* Заголовок таблицы */ +#reqList .req-table-header { + position: sticky; + top: 0; + z-index: 10; + background: var(--bs-body-bg); + border-bottom: 2px solid var(--bs-border-color); +} + +#reqList .req-table-header .req-table-row { + padding: 0.625rem 1rem; +} + +#reqList .req-table-header h6 { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; + color: var(--bs-secondary-color); + margin: 0; +} + +#reqList .req-table-header .req-cell { + align-items: center; +} + +#reqList .req-table-header .req-cell-title h6, +#reqList .req-table-header .req-cell-author h6 { + text-align: left; +} + +#reqList .req-table-header .req-cell-dates h6, +#reqList .req-table-header .req-cell-status h6, +#reqList .req-table-header .req-cell-created h6 { + text-align: center; +} + +#reqList .req-table-header .req-cell-actions h6 { + text-align: center; +} + /* Строка заявления */ #reqList .req-row { padding: 0; @@ -144,6 +185,7 @@ /* Адаптивность для планшетов */ @media (max-width: 992px) { + #reqList .req-table-header .req-table-row, #reqList .req-table-row { grid-template-columns: 42px /* Иконка */ @@ -155,6 +197,7 @@ } /* Прячем отдельную колонку действий */ + #reqList .req-table-header .req-cell-actions, #reqList .req-cell-actions { display: none; } @@ -168,6 +211,11 @@ /* Адаптивность для мобильных */ @media (max-width: 768px) { + /* Скрываем заголовок таблицы на мобильных */ + #reqList .req-table-header { + display: none; + } + #reqList .req-table-row { grid-template-columns: 36px 1fr; gap: 0.5rem; diff --git a/backend/templates/requests_app/request_list_full.html b/backend/templates/requests_app/request_list_full.html index 188e5338..f860592d 100644 --- a/backend/templates/requests_app/request_list_full.html +++ b/backend/templates/requests_app/request_list_full.html @@ -23,6 +23,31 @@ {# ===== Список ===== #} {# DEBUG: Фильтры - type: {{ filters.type }}, status: {{ filters.status }}, count: {{ requests|length }} #}
+ +
+
+
+
+
Заявление
+
+
+
Автор
+
+
+
Период
+
+
+
Статус
+
+
+
Создано
+
+
+
Действия
+
+
+
+ {% if requests %} {% for obj in requests %}
@@ -80,10 +105,18 @@
{% if obj.date_from or obj.date_to %} - {{ obj.date_from|date:"d.m.Y"|default:"—" }}
- {{ obj.date_to|date:"d.m.Y"|default:"—" }} + {% if obj.date_from %} + {{ obj.date_from|slice:":10" }}
+ {% else %} + —
+ {% endif %} + {% if obj.date_to %} + {{ obj.date_to|slice:":10" }} + {% else %} + — + {% endif %} {% else %} - — + — {% endif %}
@@ -113,8 +146,12 @@
- {{ obj.created_at|date:"d.m.Y" }}
- {{ obj.created_at|date:"H:i" }} + {% if obj.created_at %} + {{ obj.created_at|slice:":10" }}
+ {{ obj.created_at|slice:"11:16" }} + {% else %} + — + {% endif %}