feat: ajout du filtre et de la fonction de relance des adherents avec tailles manquantes
This commit is contained in:
+55
-12
@@ -21,7 +21,7 @@
|
||||
|
||||
<div class="bg-white p-6 rounded-lg border border-gray-200 shadow-sm mb-6">
|
||||
<form th:action="@{/admin/equipements/recherche}" method="get" class="space-y-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-5 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Équipement</label>
|
||||
<select name="equipementId" class="w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm px-3 py-2 border">
|
||||
@@ -36,6 +36,14 @@
|
||||
<option th:each="cat : ${categories}" th:value="${cat.id}" th:text="${cat.nom}" th:selected="${cat.id == categorieId}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Taille renseignée</label>
|
||||
<select name="tailleRenseignee" class="w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm px-3 py-2 border">
|
||||
<option value="">Toutes</option>
|
||||
<option value="true" th:selected="${tailleRenseignee != null && tailleRenseignee}">Oui (Renseignée)</option>
|
||||
<option value="false" th:selected="${tailleRenseignee != null && !tailleRenseignee}">Non (Manquante)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Fourni</label>
|
||||
<select name="fourni" class="w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm px-3 py-2 border">
|
||||
@@ -81,10 +89,26 @@
|
||||
</svg>
|
||||
Exporter Flocage Prénom / N°
|
||||
</a>
|
||||
<a th:href="@{/admin/equipements/recherche(commandee=false,tailleRenseignee=false)}"
|
||||
class="bg-amber-600 text-white px-3.5 py-2 rounded-lg text-sm font-medium hover:bg-amber-700 flex items-center space-x-1 shadow-sm transition-colors"
|
||||
title="Filtrer immédiatement les équipements non commandés dont la taille est manquante pour relancer les adhérents">
|
||||
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
||||
</svg>
|
||||
Relance Tailles Manquantes
|
||||
</a>
|
||||
<a th:href="@{/admin/exports/historique}"
|
||||
class="bg-gray-700 text-white px-3.5 py-2 rounded-lg text-sm font-medium hover:bg-gray-800 flex items-center space-x-1 shadow-sm transition-colors"
|
||||
title="Consulter et re-télécharger les anciens exports">
|
||||
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
Historique des Exports
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex space-x-3">
|
||||
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700">Rechercher</button>
|
||||
<a th:href="@{/admin/equipements/recherche/export(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee})}" class="bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700">Exporter Recherche</a>
|
||||
<a th:href="@{/admin/equipements/recherche/export(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},tailleRenseignee=${tailleRenseignee})}" class="bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700">Exporter Recherche</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -111,7 +135,16 @@
|
||||
</tr>
|
||||
<tr th:each="dotation : ${dotations}" class="hover:bg-gray-50">
|
||||
<td class="py-3 px-4 font-medium text-gray-900">
|
||||
<span th:text="${dotation.licence.adherent.nom + ' ' + dotation.licence.adherent.prenom}">Nom Prénom</span>
|
||||
<div class="font-semibold text-gray-900" th:text="${dotation.licence.adherent.nom + ' ' + dotation.licence.adherent.prenom}">Nom Prénom</div>
|
||||
<div class="text-xs text-gray-500 font-normal mt-0.5 flex flex-wrap items-center gap-1.5">
|
||||
<a th:if="${dotation.licence.adherent.email != null && !dotation.licence.adherent.email.isEmpty()}"
|
||||
th:href="'mailto:' + ${dotation.licence.adherent.email}"
|
||||
class="hover:underline text-blue-600 flex items-center"
|
||||
th:text="${dotation.licence.adherent.email}">email</a>
|
||||
<span th:if="${dotation.licence.adherent.telephone != null && !dotation.licence.adherent.telephone.isEmpty()}"
|
||||
class="text-gray-500 font-medium"
|
||||
th:text="'📞 ' + ${dotation.licence.adherent.telephone}">tél</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="py-3 px-4 text-gray-600 text-xs">
|
||||
<div th:text="${dotation.licence.adherent.typeMaillot}">Joueur</div>
|
||||
@@ -129,9 +162,19 @@
|
||||
</span>
|
||||
</td>
|
||||
<td class="py-3 px-4 text-gray-600">
|
||||
<div th:text="'T: ' + (${dotation.taille != null && !dotation.taille.isEmpty() ? dotation.taille : '-'})">Taille</div>
|
||||
<div th:if="${dotation.flocage != null && !dotation.flocage.isEmpty()}" th:text="'F: ' + ${dotation.flocage}">Flocage</div>
|
||||
<div th:if="${dotation.numero != null && !dotation.numero.isEmpty()}" th:text="'N: ' + ${dotation.numero}">N°</div>
|
||||
<div th:if="${dotation.taille != null && !dotation.taille.trim().isEmpty()}" th:text="'T: ' + ${dotation.taille}">Taille</div>
|
||||
<div th:unless="${dotation.taille != null && !dotation.taille.trim().isEmpty()}">
|
||||
<span th:if="${dotation.equipement != null && dotation.equipement.taillesDisponibles != null && !dotation.equipement.taillesDisponibles.trim().isEmpty()}"
|
||||
class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold bg-red-100 text-red-700 border border-red-200">
|
||||
⚠️ Taille manquante
|
||||
</span>
|
||||
<span th:unless="${dotation.equipement != null && dotation.equipement.taillesDisponibles != null && !dotation.equipement.taillesDisponibles.trim().isEmpty()}"
|
||||
class="text-gray-400 text-xs italic">
|
||||
Sans taille
|
||||
</span>
|
||||
</div>
|
||||
<div th:if="${dotation.flocage != null && !dotation.flocage.isEmpty()}" th:text="'F: ' + ${dotation.flocage}" class="text-xs">Flocage</div>
|
||||
<div th:if="${dotation.numero != null && !dotation.numero.isEmpty()}" th:text="'N: ' + ${dotation.numero}" class="text-xs">N°</div>
|
||||
</td>
|
||||
<td class="py-3 px-4 text-center">
|
||||
<span th:if="${dotation.commandee}" class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800" th:title="${dotation.dateCommande != null ? #temporals.format(dotation.dateCommande, 'dd/MM/yyyy HH:mm') : ''}">
|
||||
@@ -160,12 +203,12 @@
|
||||
<div class="flex items-center space-x-2" th:if="${totalPages > 1}">
|
||||
<!-- Page Précédente -->
|
||||
<a th:if="${currentPage > 0}"
|
||||
th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},page=${currentPage - 1})}"
|
||||
th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},tailleRenseignee=${tailleRenseignee},page=${currentPage - 1})}"
|
||||
hx-get="/admin/equipements/recherche"
|
||||
hx-target="#equipements-table-container"
|
||||
hx-select="#equipements-table-container"
|
||||
hx-push-url="true"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "page": ${currentPage - 1}}|"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "tailleRenseignee": "${tailleRenseignee != null ? tailleRenseignee : ''}", "page": ${currentPage - 1}}|"
|
||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
||||
Précédent
|
||||
</a>
|
||||
@@ -175,12 +218,12 @@
|
||||
|
||||
<!-- Numéros de pages -->
|
||||
<th:block th:each="pageNum : ${#numbers.sequence(0, totalPages - 1)}" th:if="${totalPages > 0}">
|
||||
<a th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},page=${pageNum})}"
|
||||
<a th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},tailleRenseignee=${tailleRenseignee},page=${pageNum})}"
|
||||
hx-get="/admin/equipements/recherche"
|
||||
hx-target="#equipements-table-container"
|
||||
hx-select="#equipements-table-container"
|
||||
hx-push-url="true"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "page": ${pageNum}}|"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "tailleRenseignee": "${tailleRenseignee != null ? tailleRenseignee : ''}", "page": ${pageNum}}|"
|
||||
th:text="${pageNum + 1}"
|
||||
class="px-3 py-1 rounded transition-colors"
|
||||
th:classappend="${currentPage == pageNum ? 'bg-blue-600 text-white' : 'border border-gray-300 hover:bg-gray-100'}">
|
||||
@@ -190,12 +233,12 @@
|
||||
|
||||
<!-- Page Suivante -->
|
||||
<a th:if="${currentPage < totalPages - 1}"
|
||||
th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},page=${currentPage + 1})}"
|
||||
th:href="@{/admin/equipements/recherche(equipementId=${equipementId},categorieId=${categorieId},fourni=${fourni},commandee=${commandee},tailleRenseignee=${tailleRenseignee},page=${currentPage + 1})}"
|
||||
hx-get="/admin/equipements/recherche"
|
||||
hx-target="#equipements-table-container"
|
||||
hx-select="#equipements-table-container"
|
||||
hx-push-url="true"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "page": ${currentPage + 1}}|"
|
||||
th:attr="hx-vals=|{"equipementId": "${equipementId != null ? equipementId : ''}", "categorieId": "${categorieId != null ? categorieId : ''}", "fourni": "${fourni != null ? fourni : ''}", "commandee": "${commandee != null ? commandee : ''}", "tailleRenseignee": "${tailleRenseignee != null ? tailleRenseignee : ''}", "page": ${currentPage + 1}}|"
|
||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
||||
Suivant
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user