[UPDT] ASSET: Added confirmation message while rejecting asset request.
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
method="post"
|
||||
onclick="event.stopPropagation()"
|
||||
onclick="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
title="Reject request"
|
||||
class="w-50"
|
||||
>
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
{{asset_allocation_form.errors}}
|
||||
<div class=" m-3">
|
||||
<div class="oh-input__group ">
|
||||
<label class="oh-input__label" for="objective">{% trans "Asset" %}</label>
|
||||
<label class="oh-input__label" for="{{asset_allocation_form.asset_id.id_for_label}}">{% trans "Asset" %}</label>
|
||||
{{asset_allocation_form.asset_id}}
|
||||
{{asset_allocation_form.asset_id.errors}}
|
||||
</div>
|
||||
<div class="oh-input__group ">
|
||||
<label class="oh-input__label" for="objective">{% trans "Assign Condition Images" %}</label>
|
||||
<label class="oh-input__label" for="{{asset_allocation_form.assign_images.id_for_label}}">{% trans "Assign Condition Images" %}</label>
|
||||
{{asset_allocation_form.assign_images}}
|
||||
{{asset_allocation_form.assign_images.errors}}
|
||||
</div>
|
||||
|
||||
@@ -309,12 +309,12 @@
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
method="post"
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Reject" %}'
|
||||
class=' w-50'
|
||||
onsubmit="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">
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
@@ -330,8 +330,7 @@
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Approve" %}'
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<a
|
||||
href="#"
|
||||
@@ -340,10 +339,8 @@
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Reject" %}'
|
||||
>
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -111,15 +111,17 @@
|
||||
<div class="oh-sticky-table__th">{% trans "Asset Category" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Request Date" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
<div class="oh-sticky-table__th" style="width:120px">{% trans "Confirmation" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
<div id="assetRequestAllocationTarget"></div>
|
||||
{% for asset_request in request_list.list %}
|
||||
<!-- asset request looping -->
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}" >
|
||||
<div class="oh-sticky-table__tr" draggable="true" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}">
|
||||
<div class="oh-sticky-table__sd" >
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img src="{{asset_request.requested_employee_id.get_avatar}}" class="oh-profile__image"
|
||||
@@ -129,10 +131,10 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__td" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}">{{asset_request.asset_category_id}}</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}">{{ asset_request.asset_request_date }}</div>
|
||||
<div class="oh-sticky-table__td">{{asset_request.asset_category_id}}</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer">{{ asset_request.asset_request_date }}</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="d-flex align-items-center" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}">
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color
|
||||
{% if asset_request.asset_request_status == 'Approved' %}
|
||||
@@ -156,24 +158,51 @@
|
||||
</div>
|
||||
</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group" >
|
||||
<a class="oh-btn oh-btn--success" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target" >
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
{% trans "Approve" %}
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger"><ion-icon
|
||||
name="close-outline"></ion-icon>{% trans "Reject" %}</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group" >
|
||||
<a class="oh-btn oh-btn--success w-50" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" onclick="event.stopPropagation()" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" title="{% trans "Approve" %}" hx-target="#asset-request-allocation-modal-target" >
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" class="w-50" method="post"
|
||||
onclick="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" title="{% trans "Reject" %}"><ion-icon
|
||||
name="close-outline"></ion-icon></button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
<a
|
||||
href="#"
|
||||
class="oh-btn oh-btn--success oh-btn--disabled w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Approve" %}'
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
<a
|
||||
href="#"
|
||||
class="oh-btn oh-btn--danger oh-btn--disabled w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Reject" %}'
|
||||
>
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Asset request Status -->
|
||||
@@ -224,12 +253,13 @@
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<a class="oh-btn oh-btn--success w-100" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target">
|
||||
<ion-icon name="checkmark-outline"></ion-icon>{% trans 'Approve' %}
|
||||
data-target="#asset-request-allocation-modal" title="{% trans 'Approve' %}" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target">
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post" class="w-100">
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" class="w-100" method="post" class="w-100"
|
||||
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100"><ion-icon name="close-outline"></ion-icon> {% trans 'Reject' %}</button>
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();" title="{% trans 'Reject' %}"><ion-icon name="close-outline"></ion-icon></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -243,6 +273,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if request_list.list.has_previous or request_list.list.has_next %}
|
||||
<div class="oh-pagination">
|
||||
<span class="oh-pagination__page">
|
||||
{% trans "Page" %} {{ request_list.list.number }}
|
||||
@@ -314,6 +345,7 @@
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -327,15 +359,17 @@
|
||||
<div class="oh-sticky-table__th">{% trans "Asset Category" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Request Date" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
<div class="oh-sticky-table__th" style="width:120px">{% trans "Confirmation" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
<div id="assetRequestAllocationTarget"></div>
|
||||
{% for asset_request in asset_requests %}
|
||||
<!-- asset request looping -->
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}" >
|
||||
<div class="oh-sticky-table__tr" draggable="true" data-toggle="oh-modal-toggle" data-target="#requestStatus{{asset_request.id}}">
|
||||
<div class="oh-sticky-table__sd" >
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img src="{{asset_request.requested_employee_id.get_avatar}}" class="oh-profile__image"
|
||||
@@ -372,24 +406,50 @@
|
||||
</div>
|
||||
</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group" >
|
||||
<a class="oh-btn oh-btn--success" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target" >
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
{% trans "Approve" %}
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger"><ion-icon
|
||||
name="close-outline"></ion-icon>{% trans "Reject" %}</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group" >
|
||||
<a class="oh-btn oh-btn--success w-50" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" onclick="event.stopPropagation()" title="{% trans "Approve" %}" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target" >
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')" class="w-50" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100"onclick="event.stopPropagation();" title="{% trans "Reject" %}"><ion-icon
|
||||
name="close-outline"></ion-icon></button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
<a
|
||||
href="#"
|
||||
class="oh-btn oh-btn--success oh-btn--disabled w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Approve" %}'
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
<a
|
||||
href="#"
|
||||
class="oh-btn oh-btn--danger oh-btn--disabled w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
title='{% trans "Reject" %}'
|
||||
>
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Asset request Status -->
|
||||
@@ -439,13 +499,14 @@
|
||||
<div class="oh-modal__dialog-footer ">
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<a class="oh-btn oh-btn--success " role="button" data-toggle="oh-modal-toggle"
|
||||
<a class="oh-btn oh-btn--success w-100" role="button" data-toggle="oh-modal-toggle"
|
||||
data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target" title="{% trans 'Approve' %}">
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post" class="">
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" class="w-100" method="post" class=""
|
||||
onsubmit="return confirm('{% trans "Do you want to reject this request?" %}')" >
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger " title="{% trans 'Reject' %}"><ion-icon
|
||||
<button class="oh-btn oh-btn--danger w-100" title="{% trans 'Reject' %}"><ion-icon
|
||||
name="close-outline"></ion-icon></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
@@ -667,6 +728,8 @@
|
||||
<!-- end asset return form start -->
|
||||
</div>
|
||||
</div>
|
||||
{% if allocation_list.list.has_previous or allocation_list.list.has_next %}
|
||||
|
||||
<div class="oh-pagination">
|
||||
<span class="oh-pagination__page">
|
||||
{% trans "Page" %} {{ allocation_list.list.number }}
|
||||
@@ -738,6 +801,7 @@
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -97,11 +97,12 @@
|
||||
</a>
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
method="post"
|
||||
class="w-100"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100">
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
|
||||
<ion-icon name="close-outline"></ion-icon> {% trans 'Reject' %}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -60,12 +60,12 @@
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
method="post"
|
||||
onclick="event.stopPropagation();return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
onsubmit="event.stopPropagation();return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
title="Reject request"
|
||||
class="w-50"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100">
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation()">
|
||||
<ion-icon name="close-circle-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -66,7 +66,8 @@
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
{% trans "Approve" %}
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post">
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post"
|
||||
onclick="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger"><ion-icon
|
||||
name="close-outline"></ion-icon>{% trans "Reject" %}</button>
|
||||
@@ -129,9 +130,10 @@
|
||||
data-target="#asset-request-allocation-modal" hx-get="{%url 'asset-request-approve' req_id=asset_request.id %}" hx-target="#asset-request-allocation-modal-target" title="{% trans 'Approve' %}">
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post" class="">
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}" method="post" class=""
|
||||
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger " title="{% trans 'Reject' %}"><ion-icon
|
||||
<button class="oh-btn oh-btn--danger " title="{% trans 'Reject' %}" onclick="event.stopPropagation();"><ion-icon
|
||||
name="close-outline"></ion-icon></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user