From 9b51884dfe18b7f8b948a99b2c813afbde74fb9d Mon Sep 17 00:00:00 2001 From: Horilla Date: Mon, 18 Mar 2024 15:34:39 +0530 Subject: [PATCH] [FIX] ASSET: Fixed redirection and return form modal --- asset/templates/asset/asset_return_form.html | 4 ++-- asset/templates/request_allocation/group_by.html | 10 +++++----- .../request_allocation/individual allocation.html | 2 +- employee/templates/tabs/asset-tab.html | 3 ++- employee/templates/tabs/profile-asset-tab.html | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/asset/templates/asset/asset_return_form.html b/asset/templates/asset/asset_return_form.html index 8fd76bce5..9c7b47ccb 100644 --- a/asset/templates/asset/asset_return_form.html +++ b/asset/templates/asset/asset_return_form.html @@ -1,6 +1,6 @@ {% load i18n %}
{% trans "Asset Return Form" %}
-
+ {% csrf_token %}
@@ -24,7 +24,7 @@
+ data-target="#asset-return-allocation-modal" hx-get="{%url 'asset-allocate-return' asset_id=asset.asset_id.id %}" hx-target="#asset-return-allocation-modal-target">{% trans "Return" %}
{% endfor %} @@ -556,7 +556,7 @@ {% if not asset_allocation.return_status %}
+ data-target="#asset-return-allocation-modal" hx-get="{%url 'asset-allocate-return' asset_id=asset_allocation.asset_id.id %}" hx-target="#asset-return-allocation-modal-target">{% trans "Return" %}
{% else %}
@@ -639,7 +639,7 @@ data-toggle="oh-modal-toggle" data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-allocate-return' asset_id=asset_allocation.asset_id.id %}" - hx-target="#asset-request-allocation-modal-target"> + hx-target="#asset-return-allocation-modal-target"> {% trans "Return" %} {%endif %}
@@ -861,9 +861,9 @@ class="oh-btn oh-btn--secondary w-100" role="button" data-toggle="oh-modal-toggle" - data-target="#asset-request-allocation-modal" + data-target="#asset-return-allocation-modal" hx-get="{%url 'asset-allocate-return' asset_id=asset_allocation.asset_id.id %}" - hx-target="#asset-request-allocation-modal-target"> + hx-target="#asset-return-allocation-modal-target"> {% trans "Return" %} {%endif %}
diff --git a/asset/templates/request_allocation/individual allocation.html b/asset/templates/request_allocation/individual allocation.html index 930caa79c..6a615a0d6 100644 --- a/asset/templates/request_allocation/individual allocation.html +++ b/asset/templates/request_allocation/individual allocation.html @@ -117,7 +117,7 @@ data-toggle="oh-modal-toggle" data-target="#asset-request-allocation-modal" hx-get="{% url 'asset-allocate-return' asset_id=asset_allocation.asset_id.id %}" - hx-target="#asset-request-allocation-modal-target" + hx-target="#asset-return-allocation-modal-target" > {% trans "Return" %} diff --git a/employee/templates/tabs/asset-tab.html b/employee/templates/tabs/asset-tab.html index 69b33939e..6dda47252 100644 --- a/employee/templates/tabs/asset-tab.html +++ b/employee/templates/tabs/asset-tab.html @@ -64,8 +64,9 @@ role="button" data-toggle="oh-modal-toggle" data-target="#asset-return-allocation-modal" - hx-get="{%url 'asset-allocate-return' asset_id=asset.id %}" + hx-get="{%url 'asset-allocate-return' asset_id=asset.asset_id.id %}" hx-target="#asset-return-allocation-modal-target" + onclick="event.stopPropagation();" > {% trans "Return" %} diff --git a/employee/templates/tabs/profile-asset-tab.html b/employee/templates/tabs/profile-asset-tab.html index bf1352eb9..17067577f 100644 --- a/employee/templates/tabs/profile-asset-tab.html +++ b/employee/templates/tabs/profile-asset-tab.html @@ -68,7 +68,7 @@ onsubmit="return confirm('{% trans "Are you sure you want to return this asset?" %}');" > {% csrf_token %} -