feat: gestion type de demande, calcul dynamique du tarif et pre-selection equipement (maillot) pour inscription
This commit is contained in:
@@ -14,9 +14,50 @@
|
||||
<h2 class="text-2xl font-bold text-gray-900 mb-2 text-center">Formulaire de pré-inscription</h2>
|
||||
<p class="text-sm text-gray-500 mb-8 text-center">Veuillez remplir les informations concernant le futur licencié.</p>
|
||||
|
||||
<div class="mb-6 p-4 bg-blue-50 border-l-4 border-blue-500 text-blue-700 text-sm rounded">
|
||||
<h3 class="font-bold mb-1">Information sur le type de demande</h3>
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
<li><strong>Nouvelle licence :</strong> Concerne les personnes qui n'étaient pas inscrites au club la saison précédente.</li>
|
||||
<li><strong>Renouvellement :</strong> Réservé aux personnes déjà inscrites au club la saison précédente.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<form th:action="@{/inscription-public/formulaire}" th:object="${preInscription}" method="post" class="space-y-6">
|
||||
<input type="hidden" name="token" th:value="${tokenUuid}" />
|
||||
|
||||
<div class="space-y-3">
|
||||
<label class="block text-sm font-medium text-gray-700">Type de demande <span class="text-red-500">*</span></label>
|
||||
<div class="flex items-center space-x-6">
|
||||
<label class="flex items-center">
|
||||
<input type="radio" th:field="*{typeDemande}" value="NOUVELLE" required class="w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500">
|
||||
<span class="ml-2 text-sm text-gray-700">Nouvelle licence</span>
|
||||
</label>
|
||||
<label class="flex items-center">
|
||||
<input type="radio" th:field="*{typeDemande}" value="RENOUVELLEMENT" required class="w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500">
|
||||
<span class="ml-2 text-sm text-gray-700">Renouvellement</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="nouvelleLicenceBlock" class="hidden space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Ancien club</label>
|
||||
<input type="text" 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 class="bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-lg">
|
||||
<h4 class="font-bold text-yellow-800 mb-2">Documents requis</h4>
|
||||
<p class="text-sm text-yellow-700 mb-2">Veuillez préparer les documents suivants pour finaliser la licence :</p>
|
||||
<ul class="list-disc pl-5 text-sm text-yellow-700 space-y-1">
|
||||
<li>Photo d’identité</li>
|
||||
<li>Carte d’identité ou passeport de l’enfant</li>
|
||||
<li>Livret de famille (si pas de pièce d’identité)</li>
|
||||
<li>Adresse e-mail du représentant légal</li>
|
||||
<li>Pour les enfants nés à l’étranger : passeport + justificatif de domicile des parents</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Nom <span class="text-red-500">*</span></label>
|
||||
@@ -88,6 +129,25 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const typeDemandeRadios = document.querySelectorAll('input[name="typeDemande"]');
|
||||
const nouvelleLicenceBlock = document.getElementById('nouvelleLicenceBlock');
|
||||
|
||||
typeDemandeRadios.forEach(radio => {
|
||||
radio.addEventListener('change', function() {
|
||||
if (this.value === 'NOUVELLE') {
|
||||
nouvelleLicenceBlock.classList.remove('hidden');
|
||||
} else {
|
||||
nouvelleLicenceBlock.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Trigger on load if already checked (e.g. going back or validation error)
|
||||
const checkedRadio = document.querySelector('input[name="typeDemande"]:checked');
|
||||
if (checkedRadio && checkedRadio.value === 'NOUVELLE') {
|
||||
nouvelleLicenceBlock.classList.remove('hidden');
|
||||
}
|
||||
|
||||
document.getElementById('dateNaissance').addEventListener('change', function() {
|
||||
const dateInput = this.value;
|
||||
const repBlock = document.getElementById('representantBlock');
|
||||
|
||||
Reference in New Issue
Block a user