From b96a128952f154610f7a3487dc31224a47435bed Mon Sep 17 00:00:00 2001 From: Horilla Date: Sat, 5 Jul 2025 15:24:55 +0530 Subject: [PATCH] [UPDT] BASE:Prevent duplicate select2 event triggers on HTMX updates --- .../condition_create_form.html | 197 ++++++++---------- .../allocation_request_update_form.html | 16 +- .../htmx/shift_allocation_form.html | 9 - 3 files changed, 84 insertions(+), 138 deletions(-) diff --git a/base/templates/multi_approval_condition/condition_create_form.html b/base/templates/multi_approval_condition/condition_create_form.html index c23c15b06..25d84e913 100644 --- a/base/templates/multi_approval_condition/condition_create_form.html +++ b/base/templates/multi_approval_condition/condition_create_form.html @@ -1,127 +1,94 @@ -{% load i18n %} {% if messages %} -
- {% for message in messages %} -
-
- {{ message }} +{% load i18n %} +{% if messages %} +
+ {% for message in messages %} +
+
+ {{ message }} +
+
+ {% endfor %} +
-
- {% endfor %} - -
{% endif %}
-

- {% trans "Multiple Approval Condition" %} -

- +

+ {% trans "Multiple Approval Condition" %} +

+
-
-
-
-
- - {{form.department }} {{form.department.errors }} + +
+
+
+ + {{ form.department }} {{ form.department.errors }} +
+
+
+
+ + {{ form.condition_field }} {{ form.condition_field.errors }} +
+
-
-
-
- - {{form.condition_field }} {{form.condition_field.errors}} +
+
+
+ + {{ form.condition_operator }} {{ form.condition_operator.errors }} +
+
+
+
+ + {{ form.condition_value }} {{ form.condition_value.errors }} +
+
-
-
-
-
-
- - {{ form.condition_operator }} {{ form.condition_operator.errors }} +
+
+
+ + {{ form.company_id }} {{ form.company_id.errors }} +
+
-
-
- - {{ form.condition_value }} {{ form.condition_value.errors }} + + {{ form.multi_approval_manager }} {{ form.multi_approval_manager.errors }}
-
-
-
-
-
- - {{ form.company_id }} {{ form.company_id.errors }} + -
-
-
- - {{ form.multi_approval_manager }} {{ form.multi_approval_manager.errors }} -
- - - + +
- diff --git a/base/templates/shift_request/allocation_request_update_form.html b/base/templates/shift_request/allocation_request_update_form.html index 6ca83f6fa..f404bfabe 100644 --- a/base/templates/shift_request/allocation_request_update_form.html +++ b/base/templates/shift_request/allocation_request_update_form.html @@ -1,16 +1,4 @@ {% load i18n %} {% load static %} -
- {{form.as_p}} + + {{form.as_p}}
- - diff --git a/base/templates/shift_request/htmx/shift_allocation_form.html b/base/templates/shift_request/htmx/shift_allocation_form.html index d4f3e8e52..e7e70b86d 100644 --- a/base/templates/shift_request/htmx/shift_allocation_form.html +++ b/base/templates/shift_request/htmx/shift_allocation_form.html @@ -24,12 +24,3 @@ {{form.as_p}}
- -