From dd31d73fed544d4d3b275ce33420fe3d82afdafb Mon Sep 17 00:00:00 2001 From: Youssef Date: Wed, 20 May 2026 21:44:34 +0200 Subject: [PATCH] feat: show dynamic labels for all equipments based on gender and playing style --- .../resources/templates/adherents/form.html | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/as-talange-web/src/main/resources/templates/adherents/form.html b/as-talange-web/src/main/resources/templates/adherents/form.html index f339477..dcd9487 100644 --- a/as-talange-web/src/main/resources/templates/adherents/form.html +++ b/as-talange-web/src/main/resources/templates/adherents/form.html @@ -255,13 +255,21 @@ th:text="${dot.equipement.obligatoire ? 'Obligatoire' : 'Facultatif'}">Obligatoire
Description
- -
- +
+ Modèle Homme - Joueur
+
+ + Modèle Homme + +
@@ -487,6 +495,35 @@ }); }); } + + // Update equipment style labels dynamically when Sexe or Type de Maillot (Poste) changes + const sexeSelect = document.getElementById('sexe'); + const typeMaillotSelect = document.getElementById('typeMaillot'); + + function updateEquipmentStyleLabels() { + if (!sexeSelect || !typeMaillotSelect) return; + const sexe = sexeSelect.value; + const typeMaillot = typeMaillotSelect.value; + + const sexeText = (sexe === 'FEMININ') ? 'Modèle Femme' : 'Modèle Homme'; + const typeText = (typeMaillot === 'GARDIEN') ? 'Gardien' : 'Joueur'; + + document.querySelectorAll('.dotation-style-label').forEach(label => { + const equip = label.getAttribute('data-equipement'); + if (equip === 'Maillot' || equip === 'Short' || equip === 'Chaussettes') { + label.textContent = `${sexeText} - ${typeText}`; + } else if (equip === 'Survêtement') { + label.textContent = sexeText; + } + }); + } + + if (sexeSelect) { + sexeSelect.addEventListener('change', updateEquipmentStyleLabels); + } + if (typeMaillotSelect) { + typeMaillotSelect.addEventListener('change', updateEquipmentStyleLabels); + } });