diff --git a/static/index/index.js b/static/index/index.js index 032f0f1cc..b017b7245 100644 --- a/static/index/index.js +++ b/static/index/index.js @@ -32,6 +32,14 @@ function getCookie(name) { return cookieValue; } +function handleSidebarToggle() { + // Delay the execution slightly to allow existing toggle logic to finish + setTimeout(() => { + const isOpen = !$('.oh-wrapper-main').hasClass('oh-wrapper-main--closed'); + localStorage.setItem('sidebarOpen', isOpen); + }, 50); +} + function addToSelectedId(newIds, storeKey) { ids = JSON.parse($(`#${storeKey}`).attr("data-ids") || "[]"); @@ -636,6 +644,34 @@ nav.after( ) ); +$(function () { + const $wrapper = $('.oh-wrapper-main'); + const sidebarOpen = localStorage.getItem('sidebarOpen'); + + if (sidebarOpen === 'false') { + $wrapper.addClass('oh-wrapper-main--closed'); + } else { + $wrapper.removeClass('oh-wrapper-main--closed'); + } + + $('#sidebar').on('mouseleave', () => { + if (localStorage.getItem('sidebarOpen') === 'false') { + $wrapper.addClass('oh-wrapper-main--closed'); + } + }); +}); + +$(document).on('click', '.oh-kanban__card-body-collapse', function (e) { + e.preventDefault(); + + var $cardBody = $(this).closest('.oh-kanban__card-body'); + + $cardBody.find('.oh-kanban__card-content').toggleClass('oh-kanban__card-content--hide'); + + $(this).toggleClass('oh-kanban__card-collapse--down'); +}); + + $(document).on("htmx:beforeRequest", function (event, data) { if ( !Array.from(event.target.getAttributeNames()).some((attr) => diff --git a/templates/dashboard.html b/templates/dashboard.html index 9a40e28e7..72d05f24b 100755 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -80,12 +80,16 @@ position: absolute; top: 50%; left: 50%; - transform: translate(-50%, -50%); /* Center the modal */ - width: 80%; /* Adjust the width of the modal */ - height: 80%; /* Adjust the height of the modal */ + transform: translate(-50%, -50%); + /* Center the modal */ + width: 80%; + /* Adjust the width of the modal */ + height: 80%; + /* Adjust the height of the modal */ overflow: hidden; z-index: 1001; - background: transparent; /* Ensure background is transparent */ + background: transparent; + /* Ensure background is transparent */ display: flex; justify-content: center; align-items: center; @@ -100,63 +104,63 @@ height: 100%; background-size: cover; filter: blur(5px); - opacity: 2; /* Adjust opacity level */ - z-index: 1000; /* Ensure it's behind the canvas */ + opacity: 2; + /* Adjust opacity level */ + z-index: 1000; + /* Ensure it's behind the canvas */ } - - -
+
- - - -
+ + + +
-
-
- {% if perms.employee.view_employee %} +
+
+ {% if perms.employee.view_employee %} {% if "recruitment"|app_installed %} -
- -
- {% if 'birthday_view'|feature_is_accessible:request or perms.employee.view_employee %} -
- {% endif %} -
-
- {% trans "Announcements" %} - {% if perms.base.add_announcement %} +
+
+ {% if 'birthday_view'|feature_is_accessible:request or perms.employee.view_employee %} +
+ {% endif %} +
+
+ {% trans "Announcements" %} + {% if perms.base.add_announcement %} - {% endif %} -
- -
- -
-
-
-
- {% if "leave"|app_installed %} - {% if perms.leave.view_leaverequest or request.user|is_reportingmanager %} -
-
- {% trans "On Leave" %} -
-
-
-
-
{% endif %} - {% endif %} - {% if perms.employee.view_employeeworkinformation or request.user|is_reportingmanager %} -
+
+ +
+ +
+
+
+
+ {% if "leave"|app_installed %} + {% if perms.leave.view_leaverequest or request.user|is_reportingmanager %} +
- {% trans "Employee Work Information" %} + {% trans "On Leave" %}
- - -
+
{% endif %} -
+ {% endif %} + {% if perms.employee.view_employeeworkinformation or request.user|is_reportingmanager %} +
+
+ {% trans "Employee Work Information" %} +
+ + +
+
+
+
+ {% endif %}
-