From c7300ccf0d66124cf0ae7c94f91ad04a74c54716 Mon Sep 17 00:00:00 2001 From: iziram Date: Tue, 18 Apr 2023 14:04:19 +0200 Subject: [PATCH] bugfix : placement modaux + affichage conflit --- app/static/js/assiduites.js | 12 +++++++++++- app/templates/assiduites/alert.j2 | 2 +- app/templates/assiduites/prompt.j2 | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/static/js/assiduites.js b/app/static/js/assiduites.js index 796015bd..e7d02771 100644 --- a/app/static/js/assiduites.js +++ b/app/static/js/assiduites.js @@ -1277,9 +1277,19 @@ function renderTimeline(assiduites, specialAssiduite) { specialAssiduiteEl.style.top = "0"; specialAssiduiteEl.style.zIndex = "0"; // Place l'assiduité spéciale en arrière-plan assiduitesContainer.appendChild(specialAssiduiteEl); - + const interval = { + deb: new moment.tz(getDate(), TIMEZONE), + fin: new moment.tz(getNextDate(), TIMEZONE), + }; //Placement des assiduités sur la timeline assiduites.forEach((assiduite) => { + const period = { + deb: new moment.tz(assiduite.date_debut, TIMEZONE), + fin: new moment.tz(assiduite.date_fin, TIMEZONE), + }; + if (!hasTimeConflict(period, interval)) { + return; + } const el = document.createElement("div"); el.className = "assiduite"; el.style.backgroundColor = getColor(assiduite.etat); diff --git a/app/templates/assiduites/alert.j2 b/app/templates/assiduites/alert.j2 index 03073e54..55d82aa8 100644 --- a/app/templates/assiduites/alert.j2 +++ b/app/templates/assiduites/alert.j2 @@ -24,7 +24,7 @@ /* Hidden by default */ position: fixed; /* Stay in place */ - z-index: 50; + z-index: 750; /* Sit on top */ padding-top: 100px; /* Location of the box */ diff --git a/app/templates/assiduites/prompt.j2 b/app/templates/assiduites/prompt.j2 index 95c0fc27..8ef15c16 100644 --- a/app/templates/assiduites/prompt.j2 +++ b/app/templates/assiduites/prompt.j2 @@ -24,7 +24,7 @@ /* Hidden by default */ position: fixed; /* Stay in place */ - z-index: 50; + z-index: 750; /* Sit on top */ padding-top: 100px; /* Location of the box */