feat: add new fields in pre-registration and sync with adherent and dotations
This commit is contained in:
@@ -55,6 +55,11 @@
|
||||
<input type="text" id="ancienClub" th:field="*{ancienClub}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none" placeholder="Nom du club (laisser vide si aucun)">
|
||||
</div>
|
||||
|
||||
<div id="raisonChangementClubBlock" class="hidden">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Raison du changement de club <span class="text-red-500">*</span></label>
|
||||
<input type="text" id="raisonChangementClub" th:field="*{raisonChangementClub}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none" placeholder="Pourquoi souhaitez-vous nous rejoindre ?">
|
||||
</div>
|
||||
|
||||
<div id="ancienneCategorieBlock" class="hidden">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Ancienne catégorie <span class="text-red-500">*</span></label>
|
||||
<select id="ancienneCategorie" th:field="*{ancienneCategorie}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
@@ -152,6 +157,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Taille de vêtement souhaitée (équipement)</label>
|
||||
<select th:field="*{tailleVetement}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
<option value="">Sélectionnez une taille...</option>
|
||||
<option th:each="taille : ${taillesDisponibles}" th:value="${taille}" th:text="${taille}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Pointure souhaitée (chaussettes)</label>
|
||||
<select th:field="*{pointure}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
<option value="">Sélectionnez une pointure...</option>
|
||||
<option th:each="pt : ${pointuresDisponibles}" th:value="${pt}" th:text="${pt}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Comment avez-vous connu l'AS Talange ?</label>
|
||||
<input type="text" th:field="*{commentConnuClub}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none" placeholder="Ex: Réseaux sociaux, amis, forum des associations...">
|
||||
</div>
|
||||
|
||||
<div class="flex items-start pt-2">
|
||||
<div class="flex items-center h-5">
|
||||
<input id="consentementRgpd" name="consentementRgpd" type="checkbox" required class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
|
||||
@@ -221,21 +248,29 @@
|
||||
const ancienClubInput = document.getElementById('ancienClub');
|
||||
const ancienneCategorieBlock = document.getElementById('ancienneCategorieBlock');
|
||||
const ancienneCategorieSelect = document.getElementById('ancienneCategorie');
|
||||
const raisonChangementClubBlock = document.getElementById('raisonChangementClubBlock');
|
||||
const raisonChangementClubInput = document.getElementById('raisonChangementClub');
|
||||
|
||||
if (ancienClubInput) {
|
||||
ancienClubInput.addEventListener('input', function() {
|
||||
if (this.value.trim().length > 0) {
|
||||
ancienneCategorieBlock.classList.remove('hidden');
|
||||
ancienneCategorieSelect.required = true;
|
||||
raisonChangementClubBlock.classList.remove('hidden');
|
||||
raisonChangementClubInput.required = true;
|
||||
} else {
|
||||
ancienneCategorieBlock.classList.add('hidden');
|
||||
ancienneCategorieSelect.required = false;
|
||||
raisonChangementClubBlock.classList.add('hidden');
|
||||
raisonChangementClubInput.required = false;
|
||||
}
|
||||
});
|
||||
// Initial check
|
||||
if (ancienClubInput.value.trim().length > 0) {
|
||||
ancienneCategorieBlock.classList.remove('hidden');
|
||||
ancienneCategorieSelect.required = true;
|
||||
raisonChangementClubBlock.classList.remove('hidden');
|
||||
raisonChangementClubInput.required = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user