From 2ec6d1935de535fb8baffb46d9675432caadecbd Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Sat, 29 Nov 2025 15:12:07 +0300 Subject: [PATCH] Refactor order edit page layout and payment UI - Move order form scope to left column only to avoid nested forms - Place payment/refund forms in right column within same grid row - Remove transaction delete button - use refunds instead for audit trail - Simplify transaction history table: show only Date, Payment Method, Amount, and Created By - Fix form submit buttons to use form attribute for proper association - Improve visual alignment of two-column layout without empty gaps This ensures valid HTML (no nested forms), clean financial audit history, and better UX with aligned columns. --- .../orders/templates/orders/order_form.html | 312 +++++++----------- 1 file changed, 119 insertions(+), 193 deletions(-) diff --git a/myproject/orders/templates/orders/order_form.html b/myproject/orders/templates/orders/order_form.html index 6fadaf4..1d14f4a 100644 --- a/myproject/orders/templates/orders/order_form.html +++ b/myproject/orders/templates/orders/order_form.html @@ -111,13 +111,12 @@ -
- {% csrf_token %} - - -
- -
+ +
+ +
+ + {% csrf_token %}
@@ -590,8 +589,9 @@
-
- + +
+
@@ -657,13 +657,10 @@ - - - - - - - + + + + @@ -674,24 +671,12 @@ {{ transaction.transaction_date|date:"d.m.Y H:i" }} - - - {% endfor %} @@ -732,12 +707,12 @@
ДатаТипСпособ оплатыСуммаПримечанияКемДатаСпособ оплатыСуммаКем
- {% if transaction.transaction_type == 'payment' %} - Платёж - {% else %} - Возврат - {% endif %} - {{ transaction.payment_method.name }} {% if transaction.transaction_type == 'refund' %}−{% else %}+{% endif %}{{ transaction.amount|floatformat:2 }} - - {{ transaction.notes|default:transaction.reason|default:"—"|truncatewords:8 }} - - {% if transaction.created_by %} @@ -701,16 +686,6 @@ {% endif %} -
- {% csrf_token %} - -
-