[UPDT] ASSET: Updated asset action for v2

This commit is contained in:
Horilla
2025-10-14 14:23:42 +05:30
parent a0654f257d
commit b42b187148
3 changed files with 34 additions and 20 deletions

View File

@@ -0,0 +1,18 @@
<div id="formContainer">
{% include "generic/horilla_form.html" %}
</div>
<script>
function toggleNotify(elm) {
$this = $(elm).val()
if ($this) {
$("#id_notify_before_parent_div").show()
} else {
$("#id_notify_before_parent_div").hide()
}
}
$(document).ready(function(){
toggleNotify($("#id_expiry_date"))
})
</script>

View File

@@ -1,4 +1,5 @@
{% load i18n %}
{% if perms.asset.add_assetassignment %}
{% if instance.asset_request_status == 'Requested' %}
<div>
@@ -15,18 +16,15 @@
>
<ion-icon name="checkmark-outline"></ion-icon>
</a>
<form
action="{% url 'asset-request-reject' req_id=instance.id %}"
method="post"
onsubmit="return confirm('{% trans "Do you want to reject this request?" %}')"
<a
class="oh-btn oh-btn--danger w-50"
role="button"
href="{% url 'asset-request-reject' instance.id %}"
onclick="return confirm(`{% trans 'Do you want to reject this request?' %}`)"
title="{% trans 'Reject' %}"
class='w-50'
>
{% csrf_token %}
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
<ion-icon name="close-outline"></ion-icon>
</button>
</form>
<ion-icon name="close-outline"></ion-icon>
</a>
</div>
</div>
{% else %}

View File

@@ -13,17 +13,15 @@
>
<ion-icon name="checkmark-outline"></ion-icon>{% trans 'Approve' %}
</a>
<form
action="{% url 'asset-request-reject' req_id=instance.id %}"
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')"
method="post"
class="w-100"
<a
class="oh-btn oh-btn--danger w-50"
role="button"
href="{% url 'asset-request-reject' instance.id %}"
onclick="return confirm(`{% trans 'Do you want to reject this request?' %}`)"
title="{% trans 'Reject' %}"
>
{% csrf_token %}
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
<ion-icon name="close-outline"></ion-icon> {% trans 'Reject' %}
</button>
</form>
<ion-icon name="close-outline"></ion-icon> {% trans 'Reject' %}
</a>
</div>
{% endif %}
{% endif %}