From 64af0d273e75d38d9e8009405225c533a8d25889 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: Tue, 9 Dec 2025 12:45:47 +0300 Subject: [PATCH] fix: improve procurement request creation UX - Change dashboard create button to use modal instead of URL redirect - Add create_as_card and create_modal parameters to page_header - Replace form POST submission with AJAX API calls - Add proper form validation and error handling - Redirect to request detail page after successful creation - Remove unused create_url from dashboard context --- backend/procurement/views_frontend.py | 1 - backend/templates/procurement/dashboard.html | 121 +++++++++++++++++- .../templates/procurement/request_list.html | 54 +++++++- 3 files changed, 173 insertions(+), 3 deletions(-) diff --git a/backend/procurement/views_frontend.py b/backend/procurement/views_frontend.py index 48948506..772819ed 100644 --- a/backend/procurement/views_frontend.py +++ b/backend/procurement/views_frontend.py @@ -64,7 +64,6 @@ def dashboard(request): 'budget': budget, 'recent_requests': recent_requests, 'can_approve': can_approve, - 'create_url': 'procurement:request_create', } return render(request, 'procurement/dashboard.html', context) diff --git a/backend/templates/procurement/dashboard.html b/backend/templates/procurement/dashboard.html index ccb5823f..4bd80932 100644 --- a/backend/templates/procurement/dashboard.html +++ b/backend/templates/procurement/dashboard.html @@ -11,7 +11,7 @@ {% block content %} {# ===== ШАПКА СТРАНИЦЫ ===== #} - {% include "includes/components/page_header.html" with icon="bi-cart3" title="Закупки" no_search=True create_url=create_url create_text="Новая заявка" %} + {% include "includes/components/page_header.html" with icon="bi-cart3" title="Закупки" no_search=True create_as_card=True create_modal="procCreateModal" create_text="Новая заявка" %} {# ===== СТАТИСТИКА ===== #}
@@ -218,8 +218,127 @@ {% endblock %} +{# ===== МОДАЛКА СОЗДАНИЯ ===== #} + + {% block extra_js %}