From 967c8a91c578f003a691e78471ff5ca3b81f19a6 Mon Sep 17 00:00:00 2001 From: lehmann Date: Thu, 28 Dec 2023 21:23:37 +0100 Subject: [PATCH] =?UTF-8?q?Partition=20editor=20:=20am=C3=A9lioration=20or?= =?UTF-8?q?donnanceur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/partition_editor.css | 39 +++++++++++++++++++----- app/templates/scolar/partition_editor.j2 | 9 ++++-- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/app/static/css/partition_editor.css b/app/static/css/partition_editor.css index e7abd0c2..95e2e65f 100644 --- a/app/static/css/partition_editor.css +++ b/app/static/css/partition_editor.css @@ -212,16 +212,21 @@ body.editionActivated .filtres>div>div>div>div { pointer-events: none; } -.grabbing>div[data-idpartition]:not([data-idgroupe]):hover:before { +.grabbing>.hidenDropZone { + pointer-events: auto !important; +} + +.grabbing>div[data-idpartition]:not([data-idgroupe]):hover:before, +.grabbing>.hidenDropZone:hover:before { content: ""; position: absolute; - left: -4px; - right: -4px; - bottom: calc(100% + 1px); - height: 2px; - width: auto; + left: -4px !important; + right: -4px !important; + bottom: calc(100% + 1px) !important; + height: 2px !important; + width: auto !important; background: #c44; - animation: insertPartion 0.2s infinite alternate ease-in-out; + animation: insertPartion 0.2s infinite alternate ease-in-out !important; } @keyframes insertPartion { @@ -283,6 +288,7 @@ body.editionActivated .filtres>div>div>div>div { #zonePartitions .filtres { width: fit-content; + position: relative; } #zonePartitions .filtres>div { @@ -332,6 +338,23 @@ body.editionActivated .filtres>div>div>div>div { margin: 4px 0 0 0; } +#zonePartitions .filtres .groupes>button { + transition: none; + position: relative; + overflow: visible; + outline: none; + border: none; +} + +#zonePartitions .filtres .hidenDropZone { + height: 100px; + position: absolute; + left: 0; + right: 0; + pointer-events: none; + background: transparent; +} + #zonePartitions .filtres .groupes>div { position: relative; background: #09c; @@ -356,7 +379,7 @@ body:not(.editionActivated) .filtres .groupes>div:active { } body.editionActivated .filtres [data-idgroupe=aucun] { - display: none; + display: none !important; } body.editionActivated .filtres .nonEditable .move { diff --git a/app/templates/scolar/partition_editor.j2 b/app/templates/scolar/partition_editor.j2 index b524a6fb..7a99ca1d 100644 --- a/app/templates/scolar/partition_editor.j2 +++ b/app/templates/scolar/partition_editor.j2 @@ -114,7 +114,7 @@ arrayPartitions.forEach((partition) => { let divPartition = templateFiltres_partition(partition); - divFiltres.appendChild(divPartition); + divFiltres.append(divPartition); let arrayGroups = Object.values(partition.groups).sort((a, b) => { return a.numero - b.numero; @@ -146,6 +146,9 @@ `; }) + let hiden = document.createElement("div"); + hiden.className = "hidenDropZone"; + divFiltres.append(hiden); document.querySelector("#zoneGroupes>.groupes").innerHTML = outputGroupes; /* Etudiants */ @@ -275,7 +278,7 @@ function listeGroupesAutoaffectation() { let output = ''; - document.querySelectorAll('#zonePartitions .filtres>div').forEach(partition => { + document.querySelectorAll('#zonePartitions .filtres>[data-idpartition]').forEach(partition => { output += ` @@ -868,7 +871,7 @@ }) // Save positions - if (this.dataset.idpartition) { + if (this.dataset.idpartition || this.classList.contains("hidenDropZone")) { let params = (new URL(document.location)).searchParams; let formsemestre_id = params.get('formsemestre_id'); var url = `/ScoDoc/{{formsemestre.departement.acronym}}/api/formsemestre/${formsemestre_id}/partitions/order`;