[UPDT] PAYROLL: Employee list view incorporated modal page to display list of related models when archiving employee

This commit is contained in:
Horilla
2024-02-12 13:53:36 +05:30
parent b573869b3e
commit 172222ceed

View File

@@ -18,6 +18,7 @@
{% trans "Online" %}
</span>
</div>
<div id="relatedModel"></div>
{% if perms.employee.view_employee or request.user|is_reportingmanager %}
<div
class="oh-checkpoint-badge text-success mb-2"
@@ -237,36 +238,31 @@
title="{% trans 'Edit' %}"
><ion-icon name="create-outline"></ion-icon
></a>
{% endif %} {% if perms.employee.delete_employee %} {% if emp.is_active %}
<form action="{% url 'employee-archive' emp.id %}"
style = "width:100%"
onsubmit="return confirm('{% trans "Do you want to archive this employee?" %}')" method="post" >
{% csrf_token %}
<button
type="submit"
class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100"
title="{% trans 'Archive' %}"
>
<ion-icon name="archive"></ion-icon>
</button>
</form>
{% else %}
{% endif %}
{% if perms.employee.delete_employee %}
{% if emp.is_active %}
<button hx-confirm="{% trans 'Do you want to archive this employee?' %}" hx-post="{% url 'employee-archive' emp.id %}"
hx-target="#relatedModel" class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100">
<ion-icon name="archive"></ion-icon>
</button>
{% else %}
<form
action="{% url 'employee-archive' emp.id %}"
onsubmit="return confirm('{% trans "Do you want to un archive this employee?" %}')" method="post"
style = "width:100%"
>
{% csrf_token %}
<button
type="submit"
class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100"
title="{% trans 'Un-Archive' %}"
>
<ion-icon name="archive"></ion-icon>
</button>
</form>
{% endif %} {% endif %} {% if perms.employee.delete_employee %}
{% csrf_token %}
<button
type="submit"
class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100"
title="{% trans 'Un-Archive' %}"
>
<ion-icon name="archive"></ion-icon>
</button>
</form>
{% endif %}
{% endif %}
{% if perms.employee.delete_employee %}
<form
action="{% url 'employee-delete' emp.id %}?view=list"
onsubmit="return confirm('{% trans "Are you sure want to delete this employee?" %}')"