[UPDT] LEAVE: Changed leave cancellation approve button

This commit is contained in:
Horilla
2024-02-15 12:17:25 +05:30
parent 7c75ed3d71
commit 44b50ef3cf

View File

@@ -163,6 +163,21 @@
</div>
<div class="oh-sticky-table__td oh-sticky-table__right" onclick="event.stopPropagation()">
<div class="oh-btn-group" >
{% if leave_request.status == 'cancelled' %}
{% if leave_request.end_date >= current_date %}
<a type="submit" data-toggle="oh-modal-toggle"
data-target="#rejectModal" hx-get="{% url 'request-cancel' leave_request.id %}" hx-target="#rejectForm" title="{% trans 'Approve cancellation request' %}"
class="oh-btn oh-btn--secondary w-100";>
<ion-icon class="me-1" name="checkmark-outline"></ion-icon>
</a>
{% else %}
<a type="submit" href="#" title="{% trans 'Approve cancellation request' %}"
class="oh-btn oh-btn--secondary oh-btn--disabled
w-100">
<ion-icon class="me-1" name="checkmark-outline"></ion-icon>
</a>
{% endif %}
{% else %}
{% if leave_request.is_approved and leave_request.status == 'requested' and leave_request.end_date >= current_date %}
<a href="{% url 'request-approve' leave_request.id %}" title="{% trans 'Approve' %}"
class="oh-btn oh-btn--success w-100" {% if leave_request.end_date.month > current_date.month %} onclick = "leaveRequestConfirm('This leave request is for the month of {{leave_request.start_date|date:'F'}}. Approval depends on the {{leave_request.employee_id.get_full_name}} having available leave days for this month.',event);" {% else %} onclick = "return confirm('Do You really want to Approve this request?')"; {% endif %}>
@@ -175,7 +190,7 @@
<ion-icon class="me-1" name="checkmark-outline"></ion-icon>
</a>
{% endif %}
{% if leave_request.status != 'rejected' and leave_request.status != 'cancelled_and_rejected' and leave_request.end_date >= current_date %}
{% if leave_request.status != 'rejected' and leave_request.end_date >= current_date %}
<a type="submit" data-toggle="oh-modal-toggle"
data-target="#rejectModal" hx-get="{% url 'request-cancel' leave_request.id %}" hx-target="#rejectForm" title="{% trans 'Reject' %}"
class="oh-btn oh-btn--danger w-100">
@@ -190,6 +205,8 @@
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>