From 3612206e5795af07379ba9989c8c48b3bd077d21 Mon Sep 17 00:00:00 2001 From: Youssef Date: Fri, 7 Aug 2026 15:22:19 +0200 Subject: [PATCH] fix(equipements): ne calculer et n'afficher que les equipements choisis sur la grille adherents --- .../web/controller/AdherentController.java | 10 ++++- .../resources/templates/adherents/list.html | 40 ++++++++++--------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/as-talange-web/src/main/java/com/astalange/web/controller/AdherentController.java b/as-talange-web/src/main/java/com/astalange/web/controller/AdherentController.java index 7a99baa..62bd049 100644 --- a/as-talange-web/src/main/java/com/astalange/web/controller/AdherentController.java +++ b/as-talange-web/src/main/java/com/astalange/web/controller/AdherentController.java @@ -97,8 +97,14 @@ public class AdherentController { if (lic == null || lic.getDotations() == null || lic.getDotations().isEmpty()) { return false; } - long total = lic.getDotations().size(); - long fournis = lic.getDotations().stream().filter(d -> Boolean.TRUE.equals(d.getFourni())).count(); + List choisis = lic.getDotations().stream() + .filter(d -> Boolean.TRUE.equals(d.getChoisi())) + .collect(java.util.stream.Collectors.toList()); + if (choisis.isEmpty()) { + return false; + } + long total = choisis.size(); + long fournis = choisis.stream().filter(d -> Boolean.TRUE.equals(d.getFourni())).count(); if ("TOUT_FOURNI".equalsIgnoreCase(eqFilter)) { return fournis == total; } else if ("PARTIEL".equalsIgnoreCase(eqFilter)) { diff --git a/as-talange-web/src/main/resources/templates/adherents/list.html b/as-talange-web/src/main/resources/templates/adherents/list.html index 3b6a51b..557e4fa 100644 --- a/as-talange-web/src/main/resources/templates/adherents/list.html +++ b/as-talange-web/src/main/resources/templates/adherents/list.html @@ -199,27 +199,29 @@ th:text="${adherent.getLicenceActuelle() != null ? adherent.getLicenceActuelle().getCategorie().getNom() + (adherent.getLicenceActuelle().getEquipe() != null ? ' (' + adherent.getLicenceActuelle().getEquipe().getNom() + ')' : '') : '-'}">- -
- - Complet (3/3) - -
- - - Maillot +
+
+ + Complet (3/3) +
+ + + Maillot + +
+
+
+ -
-
-
- -