diff --git a/public/app.js b/public/app.js index 17d6ebe..753132b 100644 --- a/public/app.js +++ b/public/app.js @@ -1,4 +1,11 @@ const ACTES_FRISE = ["Prologue", "Acte 1", "Acte 2", "Acte 3", "Épilogue"]; +const STATUT_TAGS = ['À revoir', 'À garder', 'À étudier']; + +function getStatutTag(r) { + const tags = (r.Tags || '').split(',').map(s => s.trim()); + return STATUT_TAGS.find(s => tags.includes(s)) || 'À étudier'; +} + let records = []; let columns = {}; let editingId = null; @@ -316,22 +323,31 @@ function renderFrise() { area.appendChild(container); - // Waiting zone - const waitingCards = document.getElementById('waiting-cards'); - waitingCards.innerHTML = ''; - const waitingRecords = records - .filter(r => !r.Acte || r.Acte === 'En attente') - .sort((a, b) => sortRecords(a, b, sortMode)); + // Waiting zone — pipeline de stades + const waitingRecords = records.filter(r => !r.Acte || r.Acte === 'En attente'); - waitingRecords.forEach(r => waitingCards.appendChild(makeCard(r))); + STATUT_TAGS.forEach(statut => { + const slug = statut === 'À revoir' ? 'a-revoir' : statut === 'À garder' ? 'a-garder' : 'a-etudier'; + const container = document.getElementById(`cards-${slug}`); + const counter = document.getElementById(`count-${slug}`); + if (!container) return; + container.innerHTML = ''; - new Sortable(waitingCards, { - group: 'frise', - animation: 200, - direction: 'horizontal', - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - onEnd: handleDrop, + const forStatut = waitingRecords + .filter(r => getStatutTag(r) === statut) + .sort((a, b) => sortRecords(a, b, sortMode)); + + forStatut.forEach(r => container.appendChild(makeCard(r))); + if (counter) counter.textContent = forStatut.length || ''; + + new Sortable(container, { + group: 'frise', + animation: 200, + direction: 'horizontal', + ghostClass: 'sortable-ghost', + chosenClass: 'sortable-chosen', + onEnd: handleDrop, + }); }); } @@ -649,6 +665,21 @@ document.addEventListener('keydown', e => { } }); +// Zone En attente — toggles collapsibles par section +(function initWaitingToggles() { + ['a-revoir', 'a-garder', 'a-etudier'].forEach(slug => { + const toggle = document.getElementById(`toggle-${slug}`); + const section = document.getElementById(`section-${slug}`); + if (!toggle || !section) return; + const key = `tdb-${slug}-collapsed`; + try { if (localStorage.getItem(key) === '1') section.classList.add('collapsed'); } catch(e) {} + toggle.addEventListener('click', () => { + section.classList.toggle('collapsed'); + try { localStorage.setItem(key, section.classList.contains('collapsed') ? '1' : '0'); } catch(e) {} + }); + }); +})(); + loadData(); // ══════════════════════════════════════ @@ -1897,7 +1928,7 @@ function buildFichePanel(scene) { { label: 'Intérêt narratif', value: scene['Intérêt narratif'] }, { label: 'Implications', value: scene.Implications }, { label: 'Origine', value: scene.Origine }, - { label: 'Lien rédaction', value: scene['Lien rédaction'] }, + { label: 'Notes', value: scene['Lien rédaction'] }, ]; let hasContent = false; diff --git a/public/index.html b/public/index.html index 6b64edc..d86581c 100644 --- a/public/index.html +++ b/public/index.html @@ -95,8 +95,30 @@ window.dispatchEvent(new Event('tiptap-loaded'));
Chargement...
-
En attente — glisser sur la frise
-
+
+
+ À revoir + + +
+
+
+
+
+ À garder + + +
+
+
+
+
+ À étudier + + +
+
+
@@ -289,8 +311,8 @@ window.dispatchEvent(new Event('tiptap-loaded'));
- - + +