[FIX] OFFBOARDING: Fixed resignation actions button

This commit is contained in:
Horilla
2025-09-04 09:54:06 +05:30
parent ad96eaa9bd
commit af72db01c7

View File

@@ -2,46 +2,66 @@
<div style="width : 100%" onclick="event.stopPropagation()">
<form action="{% url 'update-letter-status' %}">
{% if perms.offboarding.change_resignationletter %}
<div class="oh-btn-group">
{% if instance.status != "approved" %}
<button
title="By approving the request employee will added to the offboarding pipeline"
type="button"
onclick="event.stopPropagation();$(this).closest('form').find('input[name=status]').val('approved');resignLetterConfirmation('{% trans 'Do You really want to approve the request' %}?',$(this).closest('form').find('[type=submit]'),true);"
class="oh-btn oh-btn--success w-100 oh-btn--block w-100"
>
<ion-icon
name="checkmark"
class="mr-1 md hydrated"
role="img"
aria-label="checkmark"
></ion-icon>
</button>
{% else %}
<button
type="button"
class="oh-btn oh-btn--success oh-btn--disabled oh-btn--block w-100"
>
<ion-icon
name="checkmark"
class="mr-1 md hydrated"
role="img"
aria-label="checkmark"
></ion-icon>
</button>
{% endif %}
<button
type="button"
onclick="event.stopPropagation();$(this).closest('form').find('input[name=status]').val('rejected');resignLetterConfirmation('{% trans 'Do You really want to reject the request?' %}',$(this).closest('form').find('[type=submit]'));"
class="oh-btn oh-btn--danger oh-btn--block w-100"
>
<ion-icon
name="close-circle-outline"
class="mr-1 md hydrated"
role="img"
aria-label="close"
></ion-icon>
</button>
<div class="oh-btn-group">
{% if instance.status != "approved" %}
<button
title="By approving the request employee will added to the offboarding pipeline"
type="button"
onclick="event.stopPropagation();$(this).closest('form').find('input[name=status]').val('approved');resignLetterConfirmation('{% trans 'Do You really want to approve the request' %}?',$(this).closest('form').find('[type=submit]'),true);"
class="oh-btn oh-btn--success w-100 oh-btn--block w-100"
>
<ion-icon
name="checkmark"
class="mr-1 md hydrated"
role="img"
aria-label="checkmark"
></ion-icon>
{% trans "Approve" %}
</button>
{% else %}
<button
type="button"
class="oh-btn oh-btn--success oh-btn--disabled oh-btn--block w-100"
>
<ion-icon
name="checkmark"
class="mr-1 md hydrated"
role="img"
aria-label="checkmark"
></ion-icon>
{% trans "Approve" %}
</button>
{% endif %}
{% if instance.status == 'rejected' %}
<button
type="button"
class="oh-btn oh-btn--danger oh-btn--block w-100"
disabled
>
<ion-icon
name="close-circle-outline"
class="mr-1 md hydrated"
role="img"
aria-label="close"
></ion-icon>
{% trans "Reject" %}
</button>
{% else %}
<button
type="button"
onclick="event.stopPropagation();$(this).closest('form').find('input[name=status]').val('rejected');resignLetterConfirmation('{% trans 'Do You really want to reject the request?' %}',$(this).closest('form').find('[type=submit]'));"
class="oh-btn oh-btn--danger oh-btn--block w-100"
>
<ion-icon
name="close-circle-outline"
class="mr-1 md hydrated"
role="img"
aria-label="close"
></ion-icon>
{% trans "Reject" %}
</button>
{% endif %}
</div>
<input type="hidden" name="status" />
<input
type="hidden"
@@ -58,7 +78,6 @@
id="notice_period_ends{{instance.id}}"
/>
<button type="submit" hidden></button>
</div>
{% endif %}
<input
type="submit"