From 99223b760bb26eb9146b28c7cc26107933f2129d Mon Sep 17 00:00:00 2001 From: iziram Date: Mon, 5 Jun 2023 16:18:06 +0200 Subject: [PATCH] =?UTF-8?q?Assiduites=20:=20Mise=20=C3=A0=20jour=20diverse?= =?UTF-8?q?s=20(Page=20diff=C3=A9r=C3=A9e=20+=20live=20groupe)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/assiduites.css | 2 +- app/static/js/assiduites.js | 38 +++-- app/templates/assiduites/minitimeline.j2 | 22 +-- .../assiduites/signal_assiduites_diff.j2 | 158 +++++++++++++++++- .../assiduites/signal_assiduites_group.j2 | 2 +- app/views/assiduites.py | 18 +- 6 files changed, 197 insertions(+), 43 deletions(-) diff --git a/app/static/css/assiduites.css b/app/static/css/assiduites.css index 701cdc9b..c22e38e8 100644 --- a/app/static/css/assiduites.css +++ b/app/static/css/assiduites.css @@ -278,7 +278,7 @@ padding: 20px; border: 1px solid #888; width: 80%; - height: 30%; + height: 40%; position: relative; border-radius: 10px; diff --git a/app/static/js/assiduites.js b/app/static/js/assiduites.js index d3264bc1..015c5257 100644 --- a/app/static/js/assiduites.js +++ b/app/static/js/assiduites.js @@ -1570,26 +1570,28 @@ function resetSelection() { */ window.onload = () => { modal = document.getElementById("myModal"); - closeBtn = document.querySelector(".close"); - timeline = document.getElementById("timeline"); - deleteBtn = document.getElementById("delete"); - splitBtn = document.getElementById("split"); - editBtn = document.getElementById("edit"); - selectedAssiduite = null; + if (modal) { + closeBtn = document.querySelector(".close"); + timeline = document.getElementById("timeline"); + deleteBtn = document.getElementById("delete"); + splitBtn = document.getElementById("split"); + editBtn = document.getElementById("edit"); + selectedAssiduite = null; - closeBtn?.addEventListener("click", closeModal); + closeBtn?.addEventListener("click", closeModal); - deleteBtn?.addEventListener("click", deleteAssiduiteModal); - splitBtn?.addEventListener("click", () => { - if (selectedAssiduite) { - splitAssiduiteModal(selectedAssiduite); - } - }); - editBtn?.addEventListener("click", () => { - if (selectedAssiduite) { - editAssiduiteModal(selectedAssiduite); - } - }); + deleteBtn?.addEventListener("click", deleteAssiduiteModal); + splitBtn?.addEventListener("click", () => { + if (selectedAssiduite) { + splitAssiduiteModal(selectedAssiduite); + } + }); + editBtn?.addEventListener("click", () => { + if (selectedAssiduite) { + editAssiduiteModal(selectedAssiduite); + } + }); + } }; // <<== Gestion de la récupération d'informations ==>> diff --git a/app/templates/assiduites/minitimeline.j2 b/app/templates/assiduites/minitimeline.j2 index ebde4d0c..8de471d4 100644 --- a/app/templates/assiduites/minitimeline.j2 +++ b/app/templates/assiduites/minitimeline.j2 @@ -59,18 +59,18 @@ block.style.width = `${widthPercentage}%`; if (assiduité.etat != "CRENEAU") { - if (isSingleEtud()) { - block.addEventListener("click", () => { - let deb = startDate.hours() + startDate.minutes() / 60; - let fin = endDate.hours() + endDate.minutes() / 60; - deb = Math.max(mt_start, deb); - fin = Math.min(mt_end, fin); + block.addEventListener("click", () => { + let deb = startDate.hours() + startDate.minutes() / 60; + let fin = endDate.hours() + endDate.minutes() / 60; + deb = Math.max(mt_start, deb); + fin = Math.min(mt_end, fin); - setPeriodValues(deb, fin); + setPeriodValues(deb, fin); + if (isSingleEtud()) { updateSelectedSelect(getCurrentAssiduiteModuleImplId()); updateJustifyBtn(); - }); - } + } + }); //ajouter affichage assiduites on over setupAssiduiteBuble(block, assiduité); } @@ -272,7 +272,9 @@ position: absolute; text-align: start; top: -40px; - transform: translateX(-50%) + transform: translateX(-50%); + z-index: 50; + } .mini_tick::after { diff --git a/app/templates/assiduites/signal_assiduites_diff.j2 b/app/templates/assiduites/signal_assiduites_diff.j2 index e0061e0b..cecfe146 100644 --- a/app/templates/assiduites/signal_assiduites_diff.j2 +++ b/app/templates/assiduites/signal_assiduites_diff.j2 @@ -4,7 +4,7 @@
-
Noms
+
Noms
@@ -52,7 +52,7 @@ } .thead .tr .th { - height: 125px; + height: 200px; display: flex; justify-content: center; align-items: center; @@ -61,11 +61,12 @@ .th.sticky { z-index: 5; + cursor: pointer; } .th, .td { - padding: 10px; + padding: 20px; text-align: center; width: 200px; border: 1px solid #ddd; @@ -124,6 +125,7 @@ .th { background-color: #007BFF; color: white; + position: relative; } .tbody .tr:nth-child(even) { @@ -143,12 +145,48 @@ } #moduleimpl_select { - max-width: 175px; + max-width: 190px; + } + + .btngroup { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + } + + .btngroup>button { + background-color: transparent; + outline: none; + border: none; + cursor: pointer; + color: whitesmoke; + } + + .close { + font-size: larger; + } + + .activate { + font-size: large; + } + + .th[activated] { + transition: all 0.5s; + } + + .th[activated='false'] { + opacity: 0.5; }