From c90cd7cf261802ffd8a7861d696101dcebedc760 Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 22 May 2024 10:33:10 +0530 Subject: [PATCH] [FIX] OFFBOARDING: Fixed resignation letters loading issue --- .../resignation/request_cards.html | 73 +--------------- .../offboarding/resignation/request_list.html | 63 -------------- .../resignation/requests_view.html | 85 +++++++++++++++++-- 3 files changed, 83 insertions(+), 138 deletions(-) diff --git a/offboarding/templates/offboarding/resignation/request_cards.html b/offboarding/templates/offboarding/resignation/request_cards.html index 0e6adf8a5..f1ce46a83 100644 --- a/offboarding/templates/offboarding/resignation/request_cards.html +++ b/offboarding/templates/offboarding/resignation/request_cards.html @@ -1,12 +1,11 @@ {% load i18n %} {% load static %} {% include 'filter_tags.html' %} -{% if letters %} {% if perms.offboarding.view_resignationletter %}
- - {% trans 'Rejected' %} + style="cursor: pointer; margin-right: 15px;"> + + {% trans 'Rejected' %} @@ -21,6 +20,7 @@
{% endif %} +{% if letters %}
{% for record in letters %}
@@ -160,68 +160,3 @@ overflow-x: hidden !important; } - diff --git a/offboarding/templates/offboarding/resignation/request_list.html b/offboarding/templates/offboarding/resignation/request_list.html index 282b9a8da..e51eb3f77 100644 --- a/offboarding/templates/offboarding/resignation/request_list.html +++ b/offboarding/templates/offboarding/resignation/request_list.html @@ -300,67 +300,4 @@ } $("[type=checkbox]").change(); - function resignLetterConfirmation(params, target, approve = false) { - // Define the select box options - var selectOptions = ``; - var dateFields = '' + - `` + - '' + - ``; - - html = '

' + params + '

' - if (approve) { html = html + "
" + selectOptions + ` -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- ` + "
" } - Swal.fire({ - html: html, - icon: 'question', - showCancelButton: true, - confirmButtonColor: '#008000', - cancelButtonColor: '#d33', - confirmButtonText: "Confirm", - cancelButtonText: "Close" - }).then((result) => { - if (result.isConfirmed) { - // Access the selected value from the select box - if (approve) { - var selectedOffboarding = document.getElementById('offboardingSelect').value; - target.siblings("input[name=offboarding_id]").val(selectedOffboarding) - } - target.click(); - - if (event.target.tagName.toLowerCase() === 'form') { - event.target.submit(); - } else if (event.target.tagName.toLowerCase() === 'a') { - window.location.href = event.target.href; - } - } else { - // Handle cancel - } - }); -} - diff --git a/offboarding/templates/offboarding/resignation/requests_view.html b/offboarding/templates/offboarding/resignation/requests_view.html index 7bfd67951..ed707eeda 100644 --- a/offboarding/templates/offboarding/resignation/requests_view.html +++ b/offboarding/templates/offboarding/resignation/requests_view.html @@ -13,12 +13,9 @@ {% include "offboarding/resignation/nav.html" %} {% if letters %} -
- {% if request.GET.view == 'list' %} - {% include "offboarding/resignation/request_list.html" %} - {% else %} - {% include "offboarding/resignation/request_cards.html" %} - {% endif %} + {% include "filter_tags.html" %} +
+
{% else %}
@@ -28,4 +25,80 @@
{% endif %} + + {% endblock content %}