Axes groupés par période sur les profils utilisateur + fix soulignement des titres de cards liées

This commit is contained in:
2026-07-06 18:55:37 +02:00
parent e30b0baa50
commit 5f682a637b
7 changed files with 116 additions and 39 deletions

View File

@@ -94,42 +94,9 @@
TA.ensureVisualMode(enEditorId);
}
function groupAxesCheckboxes() {
if (!window.thalimAxesGroups || !thalimAxesGroups.length) return;
var row = document.querySelector('.' + CONFIG.rows.axes);
if (!row) return;
var list = row.querySelector('ul');
if (!list) return;
// Already grouped — nothing to do
if (list.querySelector('.axes-group-label')) return;
// Map existing <li> by checkbox value; preserve "add new" button
var liMap = {};
var addNewItem = null;
list.querySelectorAll('li').forEach(function(li) {
if (li.classList.contains('pods-pick-add-new')) { addNewItem = li; return; }
var cb = li.querySelector('input[type="checkbox"]');
if (cb) liMap[cb.value] = li;
});
// Rebuild list in group order
list.innerHTML = '';
thalimAxesGroups.forEach(function(group) {
var labelLi = document.createElement('li');
labelLi.className = 'axes-group-label';
labelLi.textContent = group.label;
list.appendChild(labelLi);
group.terms.forEach(function(term) {
var li = liMap[String(term.id)];
if (li) list.appendChild(li);
});
});
if (addNewItem) list.appendChild(addNewItem);
}
// Regroupement des axes par période — implémentation partagée dans
// admin-base.js (réutilisée par la page de profil).
var groupAxesCheckboxes = TA.groupAxesCheckboxes;
var REF_BIB_EDITOR_ID = CONFIG.editors.refBib;
var refBibReinited = false;