feat: gestion des utilisateurs, rôles et équipes

- Ajout de la section de gestion des utilisateurs avec rôles (Admin, Trésorerie, Agent de Saisie).
- Restriction des accès par rôle (Admin a tout, Trésorerie a adhérents/paiements, Agent de saisie a adhérents/planning).
- Flux de modification obligatoire de mot de passe temporaire au premier login (par défaut AsTalange123).
- Intégration de la configuration des équipes du club.
This commit is contained in:
2026-05-30 23:11:12 +02:00
parent 7e9504ffe0
commit 8a15139efb
29 changed files with 948 additions and 35 deletions
@@ -33,6 +33,15 @@
</select>
</div>
<!-- Équipe (Optionnelle) -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Équipe</label>
<select id="planningEquipe" name="equipe.id" 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="">Aucune équipe</option>
<option th:each="team : ${equipes}" th:value="${team.id}" th:text="${team.nom}" th:selected="${creneau.equipe != null && creneau.equipe.id == team.id}"></option>
</select>
</div>
<!-- Terrain -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Terrain <span class="text-red-500">*</span></label>
@@ -95,5 +104,24 @@
</div>
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function() {
const catSelect = document.getElementsByName('categorie.id')[0];
if (catSelect) {
catSelect.addEventListener('change', function() {
const catId = this.value;
const equipeSelect = document.getElementById('planningEquipe');
equipeSelect.innerHTML = '<option value="">Aucune équipe</option>';
if (catId) {
fetch('/categories/equipes?categorieId=' + catId)
.then(response => response.text())
.then(html => {
equipeSelect.innerHTML = html;
});
}
});
}
});
</script>
</body>
</html>
@@ -147,7 +147,7 @@
class="border-l-4 p-2 rounded shadow-sm flex flex-col justify-between overflow-hidden cursor-pointer hover:shadow transition-all relative z-10 m-0.5">
<div class="flex justify-between items-start">
<span class="font-bold text-xs" th:text="${c.categorie.nom}">U15</span>
<span class="font-bold text-xs" th:text="${c.categorie.nom + (c.equipe != null ? ' (' + c.equipe.nom + ')' : '')}">U15</span>
<!-- Delete button or info -->
<div class="flex items-center space-x-1">
<a th:href="@{/planning/{id}/edit(id=${c.id})}" class="text-[10px] text-gray-500 hover:underline">Modifier</a>
@@ -192,7 +192,7 @@
<td colspan="6" class="py-8 text-center text-gray-500">Aucun entraînement planifié pour ce jour.</td>
</tr>
<tr th:each="c : ${creneaux}" class="hover:bg-gray-50 transition-colors">
<td class="py-4 px-6 font-semibold text-gray-900" th:text="${c.categorie.nom}">U11</td>
<td class="py-4 px-6 font-semibold text-gray-900" th:text="${c.categorie.nom + (c.equipe != null ? ' (' + c.equipe.nom + ')' : '')}">U11</td>
<td class="py-4 px-6 text-gray-600" th:text="${c.terrain.nom}">Terrain Synthétique</td>
<td class="py-4 px-6 text-gray-600">
<span class="px-2 py-1 bg-gray-100 text-gray-800 rounded text-xs" th:text="${c.zone.libelle}">Demi A</span>