From ef5af5ee5951b5b5795e58907dbf06dfde28db24 Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 21 Feb 2024 10:48:43 +0530 Subject: [PATCH] [UPDT] BASE: Updation in rotating shift js file by adding toggleclass for display unselection of records --- base/templates/base/rotating_shift/htmx/group_by.html | 9 +++++++-- .../rotating_shift/rotating_shift_assign_view.html | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/base/templates/base/rotating_shift/htmx/group_by.html b/base/templates/base/rotating_shift/htmx/group_by.html index 6a3082c2a..6dbe85cb8 100644 --- a/base/templates/base/rotating_shift/htmx/group_by.html +++ b/base/templates/base/rotating_shift/htmx/group_by.html @@ -13,7 +13,7 @@
{% trans "Unselect All Shifts" %}
@@ -21,7 +21,7 @@ @@ -353,8 +353,10 @@ if (selectedCount === 0) { $("#selectedShowRShifts").css("display", "none"); $("#exportRShifts").css("display", "none"); + $("#unselectAllRShifts").css("display", "none"); } else { $("#exportRShifts").css("display", "inline-flex"); + $("#unselectAllRShifts").css("display", "inline-flex"); $("#selectedShowRShifts").css("display", "inline-flex"); $("#selectedShowRShifts").text(selectedCount + " - " + message); } @@ -364,6 +366,9 @@ $(document).ready(function() { $(".all-rshift-row").change(function () { + if ($('.all-rshift').is(":checked")) { + $(".all-rshift").prop("checked", false); + } addingRShiftIds(); }); diff --git a/base/templates/base/rotating_shift/rotating_shift_assign_view.html b/base/templates/base/rotating_shift/rotating_shift_assign_view.html index 864cf099f..135770ebf 100644 --- a/base/templates/base/rotating_shift/rotating_shift_assign_view.html +++ b/base/templates/base/rotating_shift/rotating_shift_assign_view.html @@ -12,14 +12,14 @@
{% trans "Unselect All Shifts" %}
@@ -195,7 +195,7 @@ -
+
{% trans "Page" %} {{ rshift_assign.number }} {% trans "of" %} {{ rshift_assign.paginator.num_pages }}. @@ -302,8 +302,10 @@ if (selectedCount === 0) { $("#selectedShowRShifts").css("display", "none"); $("#exportRShifts").css("display", "none"); + $("#unselectAllRShifts").css("display", "none"); } else { $("#exportRShifts").css("display", "inline-flex"); + $("#unselectAllRShifts").css("display", "inline-flex"); $("#selectedShowRShifts").css("display", "inline-flex"); $("#selectedShowRShifts").text(selectedCount + " - " + message); } @@ -313,6 +315,9 @@ $(document).ready(function() { $(".all-rshift-row").change(function () { + if ($('.all-rshift').is(":checked")) { + $(".all-rshift").prop("checked", false); + } addingRShiftIds(); });