Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4870d61f86 | |||
| 6ca3d0b765 | |||
| ba268a33bc | |||
| f641ccc519 | |||
| 6ea00db0dc |
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>as-talange-parent</artifactId>
|
<artifactId>as-talange-parent</artifactId>
|
||||||
<groupId>com.astalange</groupId>
|
<groupId>com.astalange</groupId>
|
||||||
<version>1.5</version>
|
<version>1.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>as-talange-parent</artifactId>
|
<artifactId>as-talange-parent</artifactId>
|
||||||
<groupId>com.astalange</groupId>
|
<groupId>com.astalange</groupId>
|
||||||
<version>1.5</version>
|
<version>1.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -50,18 +50,6 @@ public class Adherent {
|
|||||||
@Column(name = "ancienne_categorie", length = 50)
|
@Column(name = "ancienne_categorie", length = 50)
|
||||||
private String ancienneCategorie;
|
private String ancienneCategorie;
|
||||||
|
|
||||||
@Column(name = "raison_changement_club")
|
|
||||||
private String raisonChangementClub;
|
|
||||||
|
|
||||||
@Column(name = "comment_connu_club")
|
|
||||||
private String commentConnuClub;
|
|
||||||
|
|
||||||
@Column(name = "taille_vetement", length = 50)
|
|
||||||
private String tailleVetement;
|
|
||||||
|
|
||||||
@Column(length = 50)
|
|
||||||
private String pointure;
|
|
||||||
|
|
||||||
private boolean residentTalange = true;
|
private boolean residentTalange = true;
|
||||||
|
|
||||||
@Column(nullable = false, length = 10)
|
@Column(nullable = false, length = 10)
|
||||||
@@ -117,18 +105,6 @@ public class Adherent {
|
|||||||
public String getAncienneCategorie() { return ancienneCategorie; }
|
public String getAncienneCategorie() { return ancienneCategorie; }
|
||||||
public void setAncienneCategorie(String ancienneCategorie) { this.ancienneCategorie = ancienneCategorie; }
|
public void setAncienneCategorie(String ancienneCategorie) { this.ancienneCategorie = ancienneCategorie; }
|
||||||
|
|
||||||
public String getRaisonChangementClub() { return raisonChangementClub; }
|
|
||||||
public void setRaisonChangementClub(String raisonChangementClub) { this.raisonChangementClub = raisonChangementClub; }
|
|
||||||
|
|
||||||
public String getCommentConnuClub() { return commentConnuClub; }
|
|
||||||
public void setCommentConnuClub(String commentConnuClub) { this.commentConnuClub = commentConnuClub; }
|
|
||||||
|
|
||||||
public String getTailleVetement() { return tailleVetement; }
|
|
||||||
public void setTailleVetement(String tailleVetement) { this.tailleVetement = tailleVetement; }
|
|
||||||
|
|
||||||
public String getPointure() { return pointure; }
|
|
||||||
public void setPointure(String pointure) { this.pointure = pointure; }
|
|
||||||
|
|
||||||
public boolean isResidentTalange() { return residentTalange; }
|
public boolean isResidentTalange() { return residentTalange; }
|
||||||
public void setResidentTalange(boolean residentTalange) { this.residentTalange = residentTalange; }
|
public void setResidentTalange(boolean residentTalange) { this.residentTalange = residentTalange; }
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,6 @@ public class Equipement {
|
|||||||
private String couleursDisponibles;
|
private String couleursDisponibles;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "has_flocage_prenom", nullable = false)
|
|
||||||
private boolean hasFlocagePrenom = false;
|
|
||||||
|
|
||||||
@Column(name = "has_flocage_initiales", nullable = false)
|
|
||||||
private boolean hasFlocageInitiales = false;
|
|
||||||
|
|
||||||
@Column(name = "has_flocage_numero", nullable = false)
|
|
||||||
private boolean hasFlocageNumero = false;
|
|
||||||
|
|
||||||
@ManyToOne(optional = false, fetch = FetchType.LAZY)
|
@ManyToOne(optional = false, fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "saison_id", nullable = false)
|
@JoinColumn(name = "saison_id", nullable = false)
|
||||||
private Saison saison;
|
private Saison saison;
|
||||||
@@ -72,15 +63,6 @@ public class Equipement {
|
|||||||
public String getCouleursDisponibles() { return couleursDisponibles; }
|
public String getCouleursDisponibles() { return couleursDisponibles; }
|
||||||
public void setCouleursDisponibles(String couleursDisponibles) { this.couleursDisponibles = couleursDisponibles; }
|
public void setCouleursDisponibles(String couleursDisponibles) { this.couleursDisponibles = couleursDisponibles; }
|
||||||
|
|
||||||
public boolean isHasFlocagePrenom() { return hasFlocagePrenom; }
|
|
||||||
public void setHasFlocagePrenom(boolean hasFlocagePrenom) { this.hasFlocagePrenom = hasFlocagePrenom; }
|
|
||||||
|
|
||||||
public boolean isHasFlocageInitiales() { return hasFlocageInitiales; }
|
|
||||||
public void setHasFlocageInitiales(boolean hasFlocageInitiales) { this.hasFlocageInitiales = hasFlocageInitiales; }
|
|
||||||
|
|
||||||
public boolean isHasFlocageNumero() { return hasFlocageNumero; }
|
|
||||||
public void setHasFlocageNumero(boolean hasFlocageNumero) { this.hasFlocageNumero = hasFlocageNumero; }
|
|
||||||
|
|
||||||
public Saison getSaison() { return saison; }
|
public Saison getSaison() { return saison; }
|
||||||
public void setSaison(Saison saison) { this.saison = saison; }
|
public void setSaison(Saison saison) { this.saison = saison; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,6 @@ public class Licence {
|
|||||||
@Column(name = "type_licence", length = 50)
|
@Column(name = "type_licence", length = 50)
|
||||||
private String typeLicence;
|
private String typeLicence;
|
||||||
|
|
||||||
@Column(columnDefinition = "TEXT")
|
|
||||||
private String commentaire;
|
|
||||||
|
|
||||||
@OneToMany(mappedBy = "licence", cascade = CascadeType.ALL, orphanRemoval = true)
|
@OneToMany(mappedBy = "licence", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
private List<Paiement> paiements = new ArrayList<>();
|
private List<Paiement> paiements = new ArrayList<>();
|
||||||
|
|
||||||
@@ -131,9 +128,6 @@ public class Licence {
|
|||||||
public String getTypeLicence() { return typeLicence; }
|
public String getTypeLicence() { return typeLicence; }
|
||||||
public void setTypeLicence(String typeLicence) { this.typeLicence = typeLicence; }
|
public void setTypeLicence(String typeLicence) { this.typeLicence = typeLicence; }
|
||||||
|
|
||||||
public String getCommentaire() { return commentaire; }
|
|
||||||
public void setCommentaire(String commentaire) { this.commentaire = commentaire; }
|
|
||||||
|
|
||||||
public List<Paiement> getPaiements() { return paiements; }
|
public List<Paiement> getPaiements() { return paiements; }
|
||||||
public void setPaiements(List<Paiement> paiements) { this.paiements = paiements; }
|
public void setPaiements(List<Paiement> paiements) { this.paiements = paiements; }
|
||||||
|
|
||||||
|
|||||||
@@ -64,18 +64,6 @@ public class PreInscription {
|
|||||||
@Column(name = "ancienne_categorie", length = 50)
|
@Column(name = "ancienne_categorie", length = 50)
|
||||||
private String ancienneCategorie = "NA";
|
private String ancienneCategorie = "NA";
|
||||||
|
|
||||||
@Column(name = "raison_changement_club")
|
|
||||||
private String raisonChangementClub;
|
|
||||||
|
|
||||||
@Column(name = "comment_connu_club")
|
|
||||||
private String commentConnuClub;
|
|
||||||
|
|
||||||
@Column(name = "taille_vetement", length = 50)
|
|
||||||
private String tailleVetement;
|
|
||||||
|
|
||||||
@Column(length = 50)
|
|
||||||
private String pointure;
|
|
||||||
|
|
||||||
// Getters and Setters
|
// Getters and Setters
|
||||||
public Long getId() { return id; }
|
public Long getId() { return id; }
|
||||||
public void setId(Long id) { this.id = id; }
|
public void setId(Long id) { this.id = id; }
|
||||||
@@ -130,16 +118,4 @@ public class PreInscription {
|
|||||||
|
|
||||||
public String getAncienneCategorie() { return ancienneCategorie; }
|
public String getAncienneCategorie() { return ancienneCategorie; }
|
||||||
public void setAncienneCategorie(String ancienneCategorie) { this.ancienneCategorie = ancienneCategorie; }
|
public void setAncienneCategorie(String ancienneCategorie) { this.ancienneCategorie = ancienneCategorie; }
|
||||||
|
|
||||||
public String getRaisonChangementClub() { return raisonChangementClub; }
|
|
||||||
public void setRaisonChangementClub(String raisonChangementClub) { this.raisonChangementClub = raisonChangementClub; }
|
|
||||||
|
|
||||||
public String getCommentConnuClub() { return commentConnuClub; }
|
|
||||||
public void setCommentConnuClub(String commentConnuClub) { this.commentConnuClub = commentConnuClub; }
|
|
||||||
|
|
||||||
public String getTailleVetement() { return tailleVetement; }
|
|
||||||
public void setTailleVetement(String tailleVetement) { this.tailleVetement = tailleVetement; }
|
|
||||||
|
|
||||||
public String getPointure() { return pointure; }
|
|
||||||
public void setPointure(String pointure) { this.pointure = pointure; }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,18 +149,7 @@ public class CategorieService {
|
|||||||
newDotation.setTaille("");
|
newDotation.setTaille("");
|
||||||
newDotation.setNumero("");
|
newDotation.setNumero("");
|
||||||
if (licence.getAdherent() != null) {
|
if (licence.getAdherent() != null) {
|
||||||
String defaultFlocage = "";
|
newDotation.setFlocage(licence.getAdherent().getNom().toUpperCase() + " " + licence.getAdherent().getPrenom());
|
||||||
if (ce.getEquipement().isHasFlocagePrenom() && ce.getEquipement().isHasFlocageInitiales()) {
|
|
||||||
String firstInitial = licence.getAdherent().getNom() != null && !licence.getAdherent().getNom().isEmpty() ? licence.getAdherent().getNom().substring(0, 1).toUpperCase() + "." : "";
|
|
||||||
defaultFlocage = (licence.getAdherent().getPrenom() != null ? licence.getAdherent().getPrenom() + " " : "") + firstInitial;
|
|
||||||
} else if (ce.getEquipement().isHasFlocagePrenom()) {
|
|
||||||
defaultFlocage = licence.getAdherent().getPrenom() != null ? licence.getAdherent().getPrenom() : "";
|
|
||||||
} else if (ce.getEquipement().isHasFlocageInitiales()) {
|
|
||||||
String firstInitP = licence.getAdherent().getPrenom() != null && !licence.getAdherent().getPrenom().isEmpty() ? licence.getAdherent().getPrenom().substring(0, 1).toUpperCase() : "";
|
|
||||||
String firstInitN = licence.getAdherent().getNom() != null && !licence.getAdherent().getNom().isEmpty() ? licence.getAdherent().getNom().substring(0, 1).toUpperCase() : "";
|
|
||||||
defaultFlocage = firstInitP + firstInitN;
|
|
||||||
}
|
|
||||||
newDotation.setFlocage(defaultFlocage.trim());
|
|
||||||
}
|
}
|
||||||
currentDotations.add(newDotation);
|
currentDotations.add(newDotation);
|
||||||
}
|
}
|
||||||
@@ -168,37 +157,4 @@ public class CategorieService {
|
|||||||
|
|
||||||
licenceRepository.save(licence);
|
licenceRepository.save(licence);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public Categorie duplicateCategorie(Long id) {
|
|
||||||
Categorie existing = categorieRepository.findById(id)
|
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Invalid category ID: " + id));
|
|
||||||
|
|
||||||
Categorie duplicated = new Categorie();
|
|
||||||
// Appending ' (dupliqué)' and truncating if necessary since nom is max 20 chars
|
|
||||||
String newNom = existing.getNom() + " (dupliqué)";
|
|
||||||
if (newNom.length() > 20) {
|
|
||||||
newNom = newNom.substring(0, 20);
|
|
||||||
}
|
|
||||||
duplicated.setNom(newNom);
|
|
||||||
duplicated.setSexe(existing.getSexe());
|
|
||||||
duplicated.setAnneeMin(existing.getAnneeMin());
|
|
||||||
duplicated.setAnneeMax(existing.getAnneeMax());
|
|
||||||
duplicated.setTarifBase(existing.getTarifBase());
|
|
||||||
duplicated.setTarifExterieur(existing.getTarifExterieur());
|
|
||||||
duplicated.setSaison(existing.getSaison());
|
|
||||||
|
|
||||||
List<CategorieEquipement> nouveauxEquipements = new ArrayList<>();
|
|
||||||
for (CategorieEquipement ce : existing.getCategorieEquipements()) {
|
|
||||||
CategorieEquipement newCe = new CategorieEquipement();
|
|
||||||
newCe.setCategorie(duplicated);
|
|
||||||
newCe.setEquipement(ce.getEquipement());
|
|
||||||
newCe.setObligatoire(ce.getObligatoire());
|
|
||||||
newCe.setPrix(ce.getPrix() != null ? ce.getPrix() : java.math.BigDecimal.ZERO);
|
|
||||||
nouveauxEquipements.add(newCe);
|
|
||||||
}
|
|
||||||
duplicated.getCategorieEquipements().addAll(nouveauxEquipements);
|
|
||||||
|
|
||||||
return categorieRepository.save(duplicated);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,10 +48,6 @@ public class PreInscriptionService {
|
|||||||
adherent.setAncienClub(pre.getAncienClub());
|
adherent.setAncienClub(pre.getAncienClub());
|
||||||
adherent.setAncienneCategorie(pre.getAncienneCategorie());
|
adherent.setAncienneCategorie(pre.getAncienneCategorie());
|
||||||
adherent.setSexe(pre.getSexe());
|
adherent.setSexe(pre.getSexe());
|
||||||
adherent.setRaisonChangementClub(pre.getRaisonChangementClub());
|
|
||||||
adherent.setCommentConnuClub(pre.getCommentConnuClub());
|
|
||||||
adherent.setTailleVetement(pre.getTailleVetement());
|
|
||||||
adherent.setPointure(pre.getPointure());
|
|
||||||
// Par défaut
|
// Par défaut
|
||||||
adherent.setTypeMaillot("JOUEUR");
|
adherent.setTypeMaillot("JOUEUR");
|
||||||
adherent.setResidentTalange(false);
|
adherent.setResidentTalange(false);
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ALTER TABLE licence ADD COLUMN commentaire TEXT;
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
ALTER TABLE pre_inscription ADD COLUMN raison_changement_club VARCHAR(255);
|
|
||||||
ALTER TABLE pre_inscription ADD COLUMN comment_connu_club VARCHAR(255);
|
|
||||||
ALTER TABLE pre_inscription ADD COLUMN taille_vetement VARCHAR(50);
|
|
||||||
ALTER TABLE pre_inscription ADD COLUMN pointure VARCHAR(50);
|
|
||||||
|
|
||||||
ALTER TABLE adherent ADD COLUMN raison_changement_club VARCHAR(255);
|
|
||||||
ALTER TABLE adherent ADD COLUMN comment_connu_club VARCHAR(255);
|
|
||||||
ALTER TABLE adherent ADD COLUMN taille_vetement VARCHAR(50);
|
|
||||||
ALTER TABLE adherent ADD COLUMN pointure VARCHAR(50);
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
ALTER TABLE equipement ADD COLUMN has_flocage_prenom BOOLEAN DEFAULT FALSE NOT NULL;
|
|
||||||
ALTER TABLE equipement ADD COLUMN has_flocage_initiales BOOLEAN DEFAULT FALSE NOT NULL;
|
|
||||||
ALTER TABLE equipement ADD COLUMN has_flocage_numero BOOLEAN DEFAULT FALSE NOT NULL;
|
|
||||||
|
|
||||||
-- Activation automatique de l'option "numéro" pour les équipements ayant déjà des dotations avec un numéro
|
|
||||||
UPDATE equipement e
|
|
||||||
SET has_flocage_numero = TRUE
|
|
||||||
WHERE EXISTS (
|
|
||||||
SELECT 1 FROM dotation d WHERE d.equipement_id = e.id AND d.numero IS NOT NULL AND d.numero != ''
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Activation automatique de l'option "prénom" (uniquement) pour les équipements ayant déjà des dotations avec un flocage
|
|
||||||
UPDATE equipement e
|
|
||||||
SET has_flocage_prenom = TRUE
|
|
||||||
WHERE EXISTS (
|
|
||||||
SELECT 1 FROM dotation d WHERE d.equipement_id = e.id AND d.flocage IS NOT NULL AND d.flocage != ''
|
|
||||||
);
|
|
||||||
|
|
||||||
UPDATE dotation
|
|
||||||
SET flocage = a.prenom
|
|
||||||
FROM licence l
|
|
||||||
JOIN adherent a ON l.adherent_id = a.id
|
|
||||||
WHERE dotation.licence_id = l.id
|
|
||||||
AND dotation.flocage IS NOT NULL
|
|
||||||
AND dotation.flocage != ''
|
|
||||||
AND EXISTS (
|
|
||||||
SELECT 1 FROM equipement e
|
|
||||||
WHERE e.id = dotation.equipement_id
|
|
||||||
AND e.has_flocage_prenom = TRUE
|
|
||||||
AND e.has_flocage_initiales = FALSE
|
|
||||||
);
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>as-talange-parent</artifactId>
|
<artifactId>as-talange-parent</artifactId>
|
||||||
<groupId>com.astalange</groupId>
|
<groupId>com.astalange</groupId>
|
||||||
<version>1.5</version>
|
<version>1.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
|
|||||||
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
|
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.core.session.SessionRegistry;
|
|
||||||
import org.springframework.security.core.session.SessionRegistryImpl;
|
|
||||||
import org.springframework.security.web.session.HttpSessionEventPublisher;
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
@@ -44,10 +41,6 @@ public class SecurityConfig {
|
|||||||
.logout(logout -> logout
|
.logout(logout -> logout
|
||||||
.logoutSuccessUrl("/login?logout")
|
.logoutSuccessUrl("/login?logout")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
)
|
|
||||||
.sessionManagement(session -> session
|
|
||||||
.maximumSessions(100)
|
|
||||||
.sessionRegistry(sessionRegistry())
|
|
||||||
);
|
);
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
@@ -64,14 +57,4 @@ public class SecurityConfig {
|
|||||||
authProvider.setPasswordEncoder(passwordEncoder());
|
authProvider.setPasswordEncoder(passwordEncoder());
|
||||||
return authProvider;
|
return authProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public SessionRegistry sessionRegistry() {
|
|
||||||
return new SessionRegistryImpl();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public HttpSessionEventPublisher httpSessionEventPublisher() {
|
|
||||||
return new HttpSessionEventPublisher();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ public class AdherentController {
|
|||||||
@org.springframework.web.bind.annotation.RequestParam(required = false) String licence,
|
@org.springframework.web.bind.annotation.RequestParam(required = false) String licence,
|
||||||
@org.springframework.web.bind.annotation.RequestParam(required = false) String email,
|
@org.springframework.web.bind.annotation.RequestParam(required = false) String email,
|
||||||
@org.springframework.web.bind.annotation.RequestParam(required = false) String paiement,
|
@org.springframework.web.bind.annotation.RequestParam(required = false) String paiement,
|
||||||
@org.springframework.web.bind.annotation.RequestParam(required = false, defaultValue = "nom") String sortField,
|
|
||||||
@org.springframework.web.bind.annotation.RequestParam(required = false, defaultValue = "asc") String sortDirection,
|
|
||||||
@org.springframework.web.bind.annotation.RequestParam(defaultValue = "0") int page,
|
@org.springframework.web.bind.annotation.RequestParam(defaultValue = "0") int page,
|
||||||
@org.springframework.web.bind.annotation.RequestParam(defaultValue = "20") int size,
|
@org.springframework.web.bind.annotation.RequestParam(defaultValue = "20") int size,
|
||||||
Model model) {
|
Model model) {
|
||||||
@@ -115,29 +113,7 @@ public class AdherentController {
|
|||||||
model.addAttribute("paiementFilter", paiement.trim());
|
model.addAttribute("paiementFilter", paiement.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Sort
|
// 3. Paginate
|
||||||
java.util.Comparator<Adherent> comparator = (a1, a2) -> 0;
|
|
||||||
if ("nom".equalsIgnoreCase(sortField)) {
|
|
||||||
comparator = java.util.Comparator.comparing(a -> a.getNom() != null ? a.getNom() : "");
|
|
||||||
} else if ("prenom".equalsIgnoreCase(sortField)) {
|
|
||||||
comparator = java.util.Comparator.comparing(a -> a.getPrenom() != null ? a.getPrenom() : "");
|
|
||||||
} else if ("categorie".equalsIgnoreCase(sortField)) {
|
|
||||||
comparator = java.util.Comparator.comparing(a -> (a.getLicenceActuelle() != null && a.getLicenceActuelle().getCategorie() != null && a.getLicenceActuelle().getCategorie().getNom() != null) ? a.getLicenceActuelle().getCategorie().getNom() : "");
|
|
||||||
} else if ("licence".equalsIgnoreCase(sortField)) {
|
|
||||||
comparator = java.util.Comparator.comparing(a -> (a.getLicenceActuelle() != null && a.getLicenceActuelle().getNumeroLicence() != null) ? a.getLicenceActuelle().getNumeroLicence() : "");
|
|
||||||
} else if ("email".equalsIgnoreCase(sortField)) {
|
|
||||||
comparator = java.util.Comparator.comparing(a -> a.getEmail() != null ? a.getEmail() : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("desc".equalsIgnoreCase(sortDirection)) {
|
|
||||||
comparator = comparator.reversed();
|
|
||||||
}
|
|
||||||
adherents.sort(comparator);
|
|
||||||
|
|
||||||
model.addAttribute("sortField", sortField);
|
|
||||||
model.addAttribute("sortDirection", sortDirection);
|
|
||||||
|
|
||||||
// 4. Paginate
|
|
||||||
int totalElements = adherents.size();
|
int totalElements = adherents.size();
|
||||||
int totalPages = (int) Math.ceil((double) totalElements / size);
|
int totalPages = (int) Math.ceil((double) totalElements / size);
|
||||||
if (page < 0) page = 0;
|
if (page < 0) page = 0;
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ public class CategorieController {
|
|||||||
|
|
||||||
@GetMapping("/new")
|
@GetMapping("/new")
|
||||||
public String showCreateForm(Model model) {
|
public String showCreateForm(Model model) {
|
||||||
if (!model.containsAttribute("categorie")) {
|
|
||||||
model.addAttribute("categorie", new Categorie());
|
model.addAttribute("categorie", new Categorie());
|
||||||
}
|
|
||||||
Saison activeSaison = saisonRepository.findByEstActiveTrue().orElse(null);
|
Saison activeSaison = saisonRepository.findByEstActiveTrue().orElse(null);
|
||||||
model.addAttribute("allEquipements", activeSaison != null ? equipementRepository.findBySaison(activeSaison) : List.of());
|
model.addAttribute("allEquipements", activeSaison != null ? equipementRepository.findBySaison(activeSaison) : List.of());
|
||||||
return "parametrage/categories_form";
|
return "parametrage/categories_form";
|
||||||
@@ -61,26 +59,7 @@ public class CategorieController {
|
|||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public String saveCategorie(@ModelAttribute("categorie") Categorie categorie,
|
public String saveCategorie(@ModelAttribute("categorie") Categorie categorie,
|
||||||
jakarta.servlet.http.HttpServletRequest request,
|
jakarta.servlet.http.HttpServletRequest request) {
|
||||||
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) {
|
|
||||||
|
|
||||||
Saison activeSaison;
|
|
||||||
if (categorie.getId() == null) {
|
|
||||||
activeSaison = saisonRepository.findByEstActiveTrue().orElse(null);
|
|
||||||
} else {
|
|
||||||
Categorie existing = categorieRepository.findById(categorie.getId()).orElse(null);
|
|
||||||
activeSaison = existing != null ? existing.getSaison() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeSaison != null) {
|
|
||||||
for (Categorie c : categorieRepository.findBySaison(activeSaison)) {
|
|
||||||
if (c.getNom().equalsIgnoreCase(categorie.getNom()) && (categorie.getId() == null || !c.getId().equals(categorie.getId()))) {
|
|
||||||
redirectAttributes.addFlashAttribute("errorMessage", "Erreur : La catégorie '" + categorie.getNom() + "' existe déjà pour cette saison.");
|
|
||||||
redirectAttributes.addFlashAttribute("categorie", categorie);
|
|
||||||
return categorie.getId() == null ? "redirect:/categories/new" : "redirect:/categories/" + categorie.getId() + "/edit";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
java.util.Map<Long, com.astalange.core.service.CategorieService.EquipementConfig> configs = new java.util.HashMap<>();
|
java.util.Map<Long, com.astalange.core.service.CategorieService.EquipementConfig> configs = new java.util.HashMap<>();
|
||||||
|
|
||||||
@@ -114,10 +93,4 @@ public class CategorieController {
|
|||||||
categorieRepository.delete(categorie);
|
categorieRepository.delete(categorie);
|
||||||
return "redirect:/categories";
|
return "redirect:/categories";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/{id}/duplicate")
|
|
||||||
public String duplicateCategorie(@PathVariable Long id) {
|
|
||||||
categorieService.duplicateCategorie(id);
|
|
||||||
return "redirect:/categories";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-46
@@ -33,78 +33,34 @@ public class EquipementController {
|
|||||||
|
|
||||||
@GetMapping("/new")
|
@GetMapping("/new")
|
||||||
public String showCreateForm(Model model) {
|
public String showCreateForm(Model model) {
|
||||||
if (!model.containsAttribute("equipement")) {
|
|
||||||
model.addAttribute("equipement", new Equipement());
|
model.addAttribute("equipement", new Equipement());
|
||||||
}
|
|
||||||
return "parametrage/equipements_form";
|
return "parametrage/equipements_form";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{id}/edit")
|
@GetMapping("/{id}/edit")
|
||||||
public String showEditForm(@PathVariable Long id, Model model) {
|
public String showEditForm(@PathVariable Long id, Model model) {
|
||||||
if (!model.containsAttribute("equipement")) {
|
|
||||||
Equipement equipement = equipementRepository.findById(id)
|
Equipement equipement = equipementRepository.findById(id)
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Invalid equipment ID: " + id));
|
.orElseThrow(() -> new IllegalArgumentException("Invalid equipment ID: " + id));
|
||||||
model.addAttribute("equipement", equipement);
|
model.addAttribute("equipement", equipement);
|
||||||
}
|
|
||||||
return "parametrage/equipements_form";
|
return "parametrage/equipements_form";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public String saveEquipement(@ModelAttribute("equipement") Equipement equipement,
|
public String saveEquipement(@ModelAttribute("equipement") Equipement equipement) {
|
||||||
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) {
|
|
||||||
|
|
||||||
Saison activeSaison;
|
|
||||||
if (equipement.getId() == null) {
|
if (equipement.getId() == null) {
|
||||||
activeSaison = saisonRepository.findByEstActiveTrue()
|
Saison activeSaison = saisonRepository.findByEstActiveTrue()
|
||||||
.orElseThrow(() -> new IllegalStateException("Aucune saison active trouvée"));
|
.orElseThrow(() -> new IllegalStateException("Aucune saison active trouvée"));
|
||||||
equipement.setSaison(activeSaison);
|
equipement.setSaison(activeSaison);
|
||||||
} else {
|
} else {
|
||||||
Equipement existing = equipementRepository.findById(equipement.getId())
|
Equipement existing = equipementRepository.findById(equipement.getId())
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Invalid equipment ID: " + equipement.getId()));
|
.orElseThrow(() -> new IllegalArgumentException("Invalid equipment ID: " + equipement.getId()));
|
||||||
equipement.setSaison(existing.getSaison());
|
equipement.setSaison(existing.getSaison());
|
||||||
activeSaison = existing.getSaison();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeSaison != null) {
|
|
||||||
for (Equipement e : equipementRepository.findBySaison(activeSaison)) {
|
|
||||||
if (e.getNom().equalsIgnoreCase(equipement.getNom()) && (equipement.getId() == null || !e.getId().equals(equipement.getId()))) {
|
|
||||||
redirectAttributes.addFlashAttribute("errorMessage", "Erreur : L'équipement '" + equipement.getNom() + "' existe déjà pour cette saison.");
|
|
||||||
redirectAttributes.addFlashAttribute("equipement", equipement);
|
|
||||||
return equipement.getId() == null ? "redirect:/equipements/new" : "redirect:/equipements/" + equipement.getId() + "/edit";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
equipementRepository.save(equipement);
|
equipementRepository.save(equipement);
|
||||||
return "redirect:/equipements";
|
return "redirect:/equipements";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/{id}/duplicate")
|
|
||||||
public String duplicateEquipement(@PathVariable Long id) {
|
|
||||||
Equipement existing = equipementRepository.findById(id)
|
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Invalid equipment ID: " + id));
|
|
||||||
|
|
||||||
Equipement duplicated = new Equipement();
|
|
||||||
String newNom = existing.getNom() + " (dupliqué)";
|
|
||||||
if (newNom.length() > 100) {
|
|
||||||
newNom = newNom.substring(0, 100);
|
|
||||||
}
|
|
||||||
duplicated.setNom(newNom);
|
|
||||||
duplicated.setReference(existing.getReference());
|
|
||||||
duplicated.setDescription(existing.getDescription());
|
|
||||||
duplicated.setGestionSexe(existing.isGestionSexe());
|
|
||||||
duplicated.setTypePublic(existing.getTypePublic());
|
|
||||||
duplicated.setTaillesDisponibles(existing.getTaillesDisponibles());
|
|
||||||
duplicated.setCouleursDisponibles(existing.getCouleursDisponibles());
|
|
||||||
duplicated.setHasFlocagePrenom(existing.isHasFlocagePrenom());
|
|
||||||
duplicated.setHasFlocageInitiales(existing.isHasFlocageInitiales());
|
|
||||||
duplicated.setHasFlocageNumero(existing.isHasFlocageNumero());
|
|
||||||
duplicated.setSaison(existing.getSaison());
|
|
||||||
|
|
||||||
equipementRepository.save(duplicated);
|
|
||||||
return "redirect:/equipements";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/{id}/delete")
|
@PostMapping("/{id}/delete")
|
||||||
public String deleteEquipement(@PathVariable Long id) {
|
public String deleteEquipement(@PathVariable Long id) {
|
||||||
Equipement equipement = equipementRepository.findById(id)
|
Equipement equipement = equipementRepository.findById(id)
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ public class LicenceController {
|
|||||||
@RequestParam(required = false) String numeroLicence,
|
@RequestParam(required = false) String numeroLicence,
|
||||||
@RequestParam(required = false) String typeDemande,
|
@RequestParam(required = false) String typeDemande,
|
||||||
@RequestParam(required = false) String typeLicence,
|
@RequestParam(required = false) String typeLicence,
|
||||||
@RequestParam(required = false) String commentaire,
|
|
||||||
@RequestParam(required = false) Long equipeId) {
|
@RequestParam(required = false) Long equipeId) {
|
||||||
|
|
||||||
Adherent adherent = adherentRepository.findById(id)
|
Adherent adherent = adherentRepository.findById(id)
|
||||||
@@ -74,7 +73,6 @@ public class LicenceController {
|
|||||||
licence.setNumeroLicence(numeroLicence);
|
licence.setNumeroLicence(numeroLicence);
|
||||||
licence.setTypeDemande(typeDemande);
|
licence.setTypeDemande(typeDemande);
|
||||||
licence.setTypeLicence(typeLicence);
|
licence.setTypeLicence(typeLicence);
|
||||||
licence.setCommentaire(commentaire);
|
|
||||||
|
|
||||||
if (equipeId != null) {
|
if (equipeId != null) {
|
||||||
Equipe equipe = equipeRepository.findById(equipeId)
|
Equipe equipe = equipeRepository.findById(equipeId)
|
||||||
@@ -99,7 +97,6 @@ public class LicenceController {
|
|||||||
@RequestParam(required = false) String numeroLicence,
|
@RequestParam(required = false) String numeroLicence,
|
||||||
@RequestParam(required = false) String typeDemande,
|
@RequestParam(required = false) String typeDemande,
|
||||||
@RequestParam(required = false) String typeLicence,
|
@RequestParam(required = false) String typeLicence,
|
||||||
@RequestParam(required = false) String commentaire,
|
|
||||||
@RequestParam(required = false) Long equipeId) {
|
@RequestParam(required = false) Long equipeId) {
|
||||||
|
|
||||||
Licence licence = licenceRepository.findById(licenceId)
|
Licence licence = licenceRepository.findById(licenceId)
|
||||||
@@ -113,7 +110,6 @@ public class LicenceController {
|
|||||||
licence.setNumeroLicence(numeroLicence);
|
licence.setNumeroLicence(numeroLicence);
|
||||||
licence.setTypeDemande(typeDemande);
|
licence.setTypeDemande(typeDemande);
|
||||||
licence.setTypeLicence(typeLicence);
|
licence.setTypeLicence(typeLicence);
|
||||||
licence.setCommentaire(commentaire);
|
|
||||||
|
|
||||||
if (equipeId != null) {
|
if (equipeId != null) {
|
||||||
Equipe equipe = equipeRepository.findById(equipeId)
|
Equipe equipe = equipeRepository.findById(equipeId)
|
||||||
|
|||||||
+1
-20
@@ -7,9 +7,7 @@ import com.astalange.core.repository.PreInscriptionRepository;
|
|||||||
import com.astalange.core.repository.TokenPreInscriptionRepository;
|
import com.astalange.core.repository.TokenPreInscriptionRepository;
|
||||||
import com.astalange.core.repository.SaisonRepository;
|
import com.astalange.core.repository.SaisonRepository;
|
||||||
import com.astalange.core.repository.CategorieRepository;
|
import com.astalange.core.repository.CategorieRepository;
|
||||||
import com.astalange.core.repository.EquipementRepository;
|
|
||||||
import com.astalange.core.entity.Categorie;
|
import com.astalange.core.entity.Categorie;
|
||||||
import com.astalange.core.entity.Equipement;
|
|
||||||
import com.astalange.core.service.CaptchaValidationService;
|
import com.astalange.core.service.CaptchaValidationService;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@@ -22,8 +20,6 @@ import java.time.LocalDate;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/inscription-public")
|
@RequestMapping("/inscription-public")
|
||||||
@@ -34,20 +30,17 @@ public class PublicInscriptionController {
|
|||||||
private final PreInscriptionRepository preInscriptionRepository;
|
private final PreInscriptionRepository preInscriptionRepository;
|
||||||
private final SaisonRepository saisonRepository;
|
private final SaisonRepository saisonRepository;
|
||||||
private final CategorieRepository categorieRepository;
|
private final CategorieRepository categorieRepository;
|
||||||
private final EquipementRepository equipementRepository;
|
|
||||||
|
|
||||||
public PublicInscriptionController(CaptchaValidationService captchaValidationService,
|
public PublicInscriptionController(CaptchaValidationService captchaValidationService,
|
||||||
TokenPreInscriptionRepository tokenRepository,
|
TokenPreInscriptionRepository tokenRepository,
|
||||||
PreInscriptionRepository preInscriptionRepository,
|
PreInscriptionRepository preInscriptionRepository,
|
||||||
SaisonRepository saisonRepository,
|
SaisonRepository saisonRepository,
|
||||||
CategorieRepository categorieRepository,
|
CategorieRepository categorieRepository) {
|
||||||
EquipementRepository equipementRepository) {
|
|
||||||
this.captchaValidationService = captchaValidationService;
|
this.captchaValidationService = captchaValidationService;
|
||||||
this.tokenRepository = tokenRepository;
|
this.tokenRepository = tokenRepository;
|
||||||
this.preInscriptionRepository = preInscriptionRepository;
|
this.preInscriptionRepository = preInscriptionRepository;
|
||||||
this.saisonRepository = saisonRepository;
|
this.saisonRepository = saisonRepository;
|
||||||
this.categorieRepository = categorieRepository;
|
this.categorieRepository = categorieRepository;
|
||||||
this.equipementRepository = equipementRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${captcha.sitekey:1x00000000000000000000AA}")
|
@Value("${captcha.sitekey:1x00000000000000000000AA}")
|
||||||
@@ -104,18 +97,6 @@ public class PublicInscriptionController {
|
|||||||
|
|
||||||
model.addAttribute("preInscription", new PreInscription());
|
model.addAttribute("preInscription", new PreInscription());
|
||||||
model.addAttribute("tokenUuid", tokenUuid);
|
model.addAttribute("tokenUuid", tokenUuid);
|
||||||
|
|
||||||
// Fetch tailles and pointures (Standard exhaustive list)
|
|
||||||
Set<String> tailles = new java.util.LinkedHashSet<>(java.util.Arrays.asList(
|
|
||||||
"5/6ANS (Taille 116cm)", "7/8ANS (Taille 128cm)", "9/10ANS (Taille 140cm)",
|
|
||||||
"11/12ANS (Taille 152cm)", "13/14ANS (Taille 164cm)", "XS", "S", "M", "L", "XL", "XXL"
|
|
||||||
));
|
|
||||||
Set<String> pointures = new java.util.LinkedHashSet<>(java.util.Arrays.asList(
|
|
||||||
"27/30 (Taille 0)", "31/34 (Taille 1)", "35/38 (Taille 2)", "39/42 (Taille 3)", "43/46 (Taille 4)"
|
|
||||||
));
|
|
||||||
model.addAttribute("taillesDisponibles", tailles);
|
|
||||||
model.addAttribute("pointuresDisponibles", pointures);
|
|
||||||
|
|
||||||
return "public/formulaire";
|
return "public/formulaire";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.astalange.web.controller;
|
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.security.core.session.SessionRegistry;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("/admin/sessions")
|
|
||||||
public class SessionController {
|
|
||||||
|
|
||||||
private final SessionRegistry sessionRegistry;
|
|
||||||
|
|
||||||
public SessionController(SessionRegistry sessionRegistry) {
|
|
||||||
this.sessionRegistry = sessionRegistry;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping
|
|
||||||
@PreAuthorize("hasRole('ADMIN')")
|
|
||||||
public String viewSessions(Model model) {
|
|
||||||
List<Object> principals = sessionRegistry.getAllPrincipals();
|
|
||||||
List<String> activeUsers = principals.stream()
|
|
||||||
.filter(principal -> principal instanceof UserDetails)
|
|
||||||
.map(principal -> ((UserDetails) principal).getUsername())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
model.addAttribute("activeUsers", activeUsers);
|
|
||||||
model.addAttribute("activeCount", activeUsers.size());
|
|
||||||
return "admin/sessions";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -187,30 +187,6 @@
|
|||||||
<option value="Senior">Senior</option>
|
<option value="Senior">Senior</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="raisonChangementClub" class="block text-sm font-medium text-gray-700 mb-1">Raison du changement</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 focus:border-blue-500 outline-none transition-colors">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
|
||||||
<div>
|
|
||||||
<label for="tailleVetement" class="block text-sm font-medium text-gray-700 mb-1">Taille équipement</label>
|
|
||||||
<input type="text" id="tailleVetement" 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 focus:border-blue-500 outline-none transition-colors">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="pointure" class="block text-sm font-medium text-gray-700 mb-1">Pointure chaussettes</label>
|
|
||||||
<input type="text" id="pointure" 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 focus:border-blue-500 outline-none transition-colors">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-6" th:classappend="${adherent.typeDemande == 'RENOUVELLEMENT'} ? 'hidden-block' : ''">
|
|
||||||
<label for="commentConnuClub" class="block text-sm font-medium text-gray-700 mb-1">Comment a-t-il connu le club ?</label>
|
|
||||||
<input type="text" id="commentConnuClub" 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 focus:border-blue-500 outline-none transition-colors">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Removed Adresse -->
|
<!-- Removed Adresse -->
|
||||||
@@ -283,8 +259,7 @@
|
|||||||
th:data-type-demande="${lic.typeDemande}"
|
th:data-type-demande="${lic.typeDemande}"
|
||||||
th:data-type-licence="${lic.typeLicence}"
|
th:data-type-licence="${lic.typeLicence}"
|
||||||
th:data-equipe-id="${lic.equipe != null ? lic.equipe.id : ''}"
|
th:data-equipe-id="${lic.equipe != null ? lic.equipe.id : ''}"
|
||||||
th:data-commentaire="${lic.commentaire}"
|
onclick="openLicenceModal(this.getAttribute('data-licence-id'), this.getAttribute('data-categorie-id'), this.getAttribute('data-numero-licence'), this.getAttribute('data-etat'), this.getAttribute('data-type-demande'), this.getAttribute('data-type-licence'), this.getAttribute('data-equipe-id'))"
|
||||||
onclick="openLicenceModal(this.getAttribute('data-licence-id'), this.getAttribute('data-categorie-id'), this.getAttribute('data-numero-licence'), this.getAttribute('data-etat'), this.getAttribute('data-type-demande'), this.getAttribute('data-type-licence'), this.getAttribute('data-equipe-id'), this.getAttribute('data-commentaire'))"
|
|
||||||
class="text-blue-600 hover:text-blue-800 font-medium bg-blue-50 px-3 py-1 rounded-lg">Modifier</button>
|
class="text-blue-600 hover:text-blue-800 font-medium bg-blue-50 px-3 py-1 rounded-lg">Modifier</button>
|
||||||
<button th:if="${lic.getResteAPayer() > 0}"
|
<button th:if="${lic.getResteAPayer() > 0}"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -413,35 +388,26 @@
|
|||||||
<div th:if="${dot.equipement.taillesDisponibles != null and !dot.equipement.taillesDisponibles.trim().isEmpty()}">
|
<div th:if="${dot.equipement.taillesDisponibles != null and !dot.equipement.taillesDisponibles.trim().isEmpty()}">
|
||||||
<label class="block text-[9px] uppercase font-bold text-gray-400">Taille</label>
|
<label class="block text-[9px] uppercase font-bold text-gray-400">Taille</label>
|
||||||
<select th:name="'taille_' + ${dot.id}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
<select th:name="'taille_' + ${dot.id}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
||||||
<option value="" th:selected="${dot.taille == null or dot.taille.isEmpty()}">Choisir...</option>
|
<option value="">Choisir...</option>
|
||||||
<option th:if="${dot.taille != null and !dot.taille.isEmpty()}"
|
|
||||||
th:value="${dot.taille}"
|
|
||||||
th:text="${dot.taille} + ' (Actuelle)'"
|
|
||||||
selected></option>
|
|
||||||
<option th:each="t : ${#strings.arraySplit(dot.equipement.taillesDisponibles, ',')}"
|
<option th:each="t : ${#strings.arraySplit(dot.equipement.taillesDisponibles, ',')}"
|
||||||
th:if="${dot.taille == null or dot.taille != #strings.trim(t)}"
|
|
||||||
th:value="${#strings.trim(t)}"
|
th:value="${#strings.trim(t)}"
|
||||||
th:text="${#strings.trim(t)}"
|
th:text="${#strings.trim(t)}"
|
||||||
th:selected="${dot.taille == null and (#strings.trim(t) == adherent.tailleVetement or #strings.trim(t) == adherent.pointure)}"></option>
|
th:selected="${dot.taille == #strings.trim(t)}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div th:if="${(dot.equipement.taillesDisponibles == null or dot.equipement.taillesDisponibles.trim().isEmpty())}">
|
<div th:if="${(dot.equipement.taillesDisponibles == null or dot.equipement.taillesDisponibles.trim().isEmpty()) and (dot.taille != null and !dot.taille.isEmpty())}">
|
||||||
<label class="block text-[9px] uppercase font-bold text-gray-400">Taille</label>
|
<label class="block text-[9px] uppercase font-bold text-gray-400">Taille</label>
|
||||||
<input type="text" th:name="'taille_' + ${dot.id}" th:value="${dot.taille != null and !dot.taille.isEmpty() ? dot.taille : (adherent.tailleVetement != null ? adherent.tailleVetement : '')}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none" placeholder="Taille/Pointure">
|
<input type="text" th:name="'taille_' + ${dot.id}" th:value="${dot.taille}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 outline-none bg-gray-50 text-gray-500" readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:if="${dot.equipement.couleursDisponibles != null and !dot.equipement.couleursDisponibles.trim().isEmpty()}">
|
<div th:if="${dot.equipement.couleursDisponibles != null and !dot.equipement.couleursDisponibles.trim().isEmpty()}">
|
||||||
<label class="block text-[9px] uppercase font-bold text-gray-400">Couleur</label>
|
<label class="block text-[9px] uppercase font-bold text-gray-400">Couleur</label>
|
||||||
<select th:name="'couleur_' + ${dot.id}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
<select th:name="'couleur_' + ${dot.id}" class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
||||||
<option value="" th:selected="${dot.couleur == null or dot.couleur.isEmpty()}">Choisir...</option>
|
<option value="">Choisir...</option>
|
||||||
<option th:if="${dot.couleur != null and !dot.couleur.isEmpty()}"
|
|
||||||
th:value="${dot.couleur}"
|
|
||||||
th:text="${dot.couleur} + ' (Actuelle)'"
|
|
||||||
selected></option>
|
|
||||||
<option th:each="c : ${#strings.arraySplit(dot.equipement.couleursDisponibles, ',')}"
|
<option th:each="c : ${#strings.arraySplit(dot.equipement.couleursDisponibles, ',')}"
|
||||||
th:if="${dot.couleur == null or dot.couleur != #strings.trim(c)}"
|
|
||||||
th:value="${#strings.trim(c)}"
|
th:value="${#strings.trim(c)}"
|
||||||
th:text="${#strings.trim(c)}"></option>
|
th:text="${#strings.trim(c)}"
|
||||||
|
th:selected="${dot.couleur == #strings.trim(c)}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div th:if="${(dot.equipement.couleursDisponibles == null or dot.equipement.couleursDisponibles.trim().isEmpty()) and (dot.couleur != null and !dot.couleur.isEmpty())}">
|
<div th:if="${(dot.equipement.couleursDisponibles == null or dot.equipement.couleursDisponibles.trim().isEmpty()) and (dot.couleur != null and !dot.couleur.isEmpty())}">
|
||||||
@@ -451,14 +417,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-1.5 mb-1.5">
|
<div class="grid grid-cols-2 gap-1.5 mb-1.5">
|
||||||
<div th:if="${dot.equipement.hasFlocageNumero}">
|
<div>
|
||||||
<label class="block text-[9px] uppercase font-bold text-gray-400">Numéro</label>
|
<label class="block text-[9px] uppercase font-bold text-gray-400">Numéro</label>
|
||||||
<input type="text" th:name="'numero_' + ${dot.id}" th:value="${dot.numero}" placeholder="Ex: 10"
|
<input type="text" th:name="'numero_' + ${dot.id}" th:value="${dot.numero}" placeholder="Ex: 10"
|
||||||
class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
||||||
</div>
|
</div>
|
||||||
<div th:if="${dot.equipement.hasFlocagePrenom or dot.equipement.hasFlocageInitiales}">
|
<div>
|
||||||
<label class="block text-[9px] uppercase font-bold text-gray-400 whitespace-nowrap truncate" title="Flocage" th:text="'Flocage (' + (${dot.equipement.hasFlocagePrenom and dot.equipement.hasFlocageInitiales} ? 'Prénom/Init.' : (${dot.equipement.hasFlocagePrenom} ? 'Prénom' : 'Initiales')) + ')'">Flocage</label>
|
<label class="block text-[9px] uppercase font-bold text-gray-400">Flocage</label>
|
||||||
<input type="text" th:name="'flocage_' + ${dot.id}" th:value="${dot.flocage}" placeholder="À floquer"
|
<input type="text" th:name="'flocage_' + ${dot.id}" th:value="${dot.flocage}" placeholder="Nom du joueur"
|
||||||
class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
class="w-full text-xs border border-gray-300 rounded px-1 py-0.5 focus:ring-1 focus:ring-blue-500 outline-none">
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center pt-1.5">
|
<div class="flex items-center pt-1.5">
|
||||||
@@ -547,10 +513,6 @@
|
|||||||
<option value="Payée">Payée</option>
|
<option value="Payée">Payée</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Commentaire</label>
|
|
||||||
<textarea id="licenceCommentaireInput" name="commentaire" rows="3" 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="Commentaire optionnel..."></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="items-center px-4 py-3 flex justify-end space-x-2">
|
<div class="items-center px-4 py-3 flex justify-end space-x-2">
|
||||||
<button type="button" onclick="closeLicenceModal()" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50">Annuler</button>
|
<button type="button" onclick="closeLicenceModal()" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50">Annuler</button>
|
||||||
<button type="submit" class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700">Enregistrer</button>
|
<button type="submit" class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700">Enregistrer</button>
|
||||||
@@ -641,7 +603,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
function openLicenceModal(licenceId = null, categorieId = '', numeroLicence = '', etat = 'Brouillon', typeDemande = '', typeLicence = '', equipeId = '', commentaire = '') {
|
function openLicenceModal(licenceId = null, categorieId = '', numeroLicence = '', etat = 'Brouillon', typeDemande = '', typeLicence = '', equipeId = '') {
|
||||||
document.getElementById('licenceModal').classList.remove('hidden');
|
document.getElementById('licenceModal').classList.remove('hidden');
|
||||||
const form = document.getElementById('licenceForm');
|
const form = document.getElementById('licenceForm');
|
||||||
const title = document.getElementById('licenceModalTitle');
|
const title = document.getElementById('licenceModalTitle');
|
||||||
@@ -660,7 +622,6 @@
|
|||||||
document.getElementById('etatSelect').value = etat;
|
document.getElementById('etatSelect').value = etat;
|
||||||
document.getElementById('typeDemandeSelect').value = typeDemande;
|
document.getElementById('typeDemandeSelect').value = typeDemande;
|
||||||
document.getElementById('typeLicenceSelect').value = typeLicence;
|
document.getElementById('typeLicenceSelect').value = typeLicence;
|
||||||
document.getElementById('licenceCommentaireInput').value = commentaire || '';
|
|
||||||
|
|
||||||
// Fetch and populate teams
|
// Fetch and populate teams
|
||||||
if (categorieId) {
|
if (categorieId) {
|
||||||
@@ -676,7 +637,6 @@
|
|||||||
form.action = '/adherents/' + adherentId + '/licences';
|
form.action = '/adherents/' + adherentId + '/licences';
|
||||||
document.getElementById('numeroLicenceInput').value = '';
|
document.getElementById('numeroLicenceInput').value = '';
|
||||||
document.getElementById('etatSelect').value = 'Brouillon';
|
document.getElementById('etatSelect').value = 'Brouillon';
|
||||||
document.getElementById('licenceCommentaireInput').value = '';
|
|
||||||
|
|
||||||
// Pré-remplissage du type de demande
|
// Pré-remplissage du type de demande
|
||||||
const adherentTypeDemande = document.getElementById('typeDemande') ? document.getElementById('typeDemande').value : '';
|
const adherentTypeDemande = document.getElementById('typeDemande') ? document.getElementById('typeDemande').value : '';
|
||||||
|
|||||||
@@ -58,63 +58,16 @@
|
|||||||
<table class="w-full text-left border-collapse min-w-[1000px]">
|
<table class="w-full text-left border-collapse min-w-[1000px]">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-gray-50 text-gray-500 text-sm uppercase tracking-wider border-b border-gray-200">
|
<tr class="bg-gray-50 text-gray-500 text-sm uppercase tracking-wider border-b border-gray-200">
|
||||||
<th class="py-3 px-6 font-medium text-left cursor-pointer hover:bg-gray-100 transition-colors group select-none" onclick="updateSort('nom')">
|
<th class="py-3 px-6 font-medium text-left">Nom</th>
|
||||||
<div class="flex items-center space-x-1">
|
<th class="py-3 px-6 font-medium text-left">Prénom</th>
|
||||||
<span>Nom</span>
|
<th class="py-3 px-6 font-medium text-left">Catégorie</th>
|
||||||
<span th:if="${sortField != 'nom'}"><svg class="w-3.5 h-3.5 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4"></path></svg></span>
|
<th class="py-3 px-6 font-medium text-center">N° Licence</th>
|
||||||
<span th:if="${sortField == 'nom'}">
|
<th class="py-3 px-6 font-medium text-left">Email</th>
|
||||||
<svg th:if="${sortDirection == 'asc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 15l7-7 7 7"></path></svg>
|
|
||||||
<svg th:if="${sortDirection == 'desc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-left cursor-pointer hover:bg-gray-100 transition-colors group select-none" onclick="updateSort('prenom')">
|
|
||||||
<div class="flex items-center space-x-1">
|
|
||||||
<span>Prénom</span>
|
|
||||||
<span th:if="${sortField != 'prenom'}"><svg class="w-3.5 h-3.5 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4"></path></svg></span>
|
|
||||||
<span th:if="${sortField == 'prenom'}">
|
|
||||||
<svg th:if="${sortDirection == 'asc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 15l7-7 7 7"></path></svg>
|
|
||||||
<svg th:if="${sortDirection == 'desc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-left cursor-pointer hover:bg-gray-100 transition-colors group select-none" onclick="updateSort('categorie')">
|
|
||||||
<div class="flex items-center space-x-1">
|
|
||||||
<span>Catégorie</span>
|
|
||||||
<span th:if="${sortField != 'categorie'}"><svg class="w-3.5 h-3.5 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4"></path></svg></span>
|
|
||||||
<span th:if="${sortField == 'categorie'}">
|
|
||||||
<svg th:if="${sortDirection == 'asc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 15l7-7 7 7"></path></svg>
|
|
||||||
<svg th:if="${sortDirection == 'desc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-center cursor-pointer hover:bg-gray-100 transition-colors group select-none" onclick="updateSort('licence')">
|
|
||||||
<div class="flex items-center justify-center space-x-1">
|
|
||||||
<span>N° Licence</span>
|
|
||||||
<span th:if="${sortField != 'licence'}"><svg class="w-3.5 h-3.5 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4"></path></svg></span>
|
|
||||||
<span th:if="${sortField == 'licence'}">
|
|
||||||
<svg th:if="${sortDirection == 'asc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 15l7-7 7 7"></path></svg>
|
|
||||||
<svg th:if="${sortDirection == 'desc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-left cursor-pointer hover:bg-gray-100 transition-colors group select-none" onclick="updateSort('email')">
|
|
||||||
<div class="flex items-center space-x-1">
|
|
||||||
<span>Email</span>
|
|
||||||
<span th:if="${sortField != 'email'}"><svg class="w-3.5 h-3.5 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4"></path></svg></span>
|
|
||||||
<span th:if="${sortField == 'email'}">
|
|
||||||
<svg th:if="${sortDirection == 'asc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 15l7-7 7 7"></path></svg>
|
|
||||||
<svg th:if="${sortDirection == 'desc'}" class="w-3.5 h-3.5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-center">Paiement</th>
|
<th class="py-3 px-6 font-medium text-center">Paiement</th>
|
||||||
<th class="py-3 px-6 font-medium text-right">Actions</th>
|
<th class="py-3 px-6 font-medium text-right">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Filter Row -->
|
<!-- Filter Row -->
|
||||||
<tr id="filter-row" class="bg-gray-100 border-b border-gray-200 text-xs">
|
<tr id="filter-row" class="bg-gray-100 border-b border-gray-200 text-xs">
|
||||||
<input type="hidden" name="sortField" id="sortField" th:value="${sortField}">
|
|
||||||
<input type="hidden" name="sortDirection" id="sortDirection" th:value="${sortDirection}">
|
|
||||||
<td class="py-2 px-3">
|
<td class="py-2 px-3">
|
||||||
<input type="text" id="filterNom" name="nom" th:value="${nomFilter}" placeholder="Filtrer Nom..." class="w-full border border-gray-300 rounded px-2 py-1 text-xs focus:ring-1 focus:ring-blue-500 focus:outline-none">
|
<input type="text" id="filterNom" name="nom" th:value="${nomFilter}" placeholder="Filtrer Nom..." class="w-full border border-gray-300 rounded px-2 py-1 text-xs focus:ring-1 focus:ring-blue-500 focus:outline-none">
|
||||||
</td>
|
</td>
|
||||||
@@ -222,7 +175,7 @@
|
|||||||
hx-target="#adherents-table-container"
|
hx-target="#adherents-table-container"
|
||||||
hx-select="#adherents-table-container"
|
hx-select="#adherents-table-container"
|
||||||
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
||||||
th:attr="hx-vals=|{"page": ${currentPage - 1}}|"
|
th:attr="hx-vals=|{'page': ${currentPage - 1}}|"
|
||||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
||||||
Précédent
|
Précédent
|
||||||
</button>
|
</button>
|
||||||
@@ -237,7 +190,7 @@
|
|||||||
hx-target="#adherents-table-container"
|
hx-target="#adherents-table-container"
|
||||||
hx-select="#adherents-table-container"
|
hx-select="#adherents-table-container"
|
||||||
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
||||||
th:attr="hx-vals=|{"page": ${pageNum}}|"
|
th:attr="hx-vals=|{'page': ${pageNum}}|"
|
||||||
th:text="${pageNum + 1}"
|
th:text="${pageNum + 1}"
|
||||||
class="px-3 py-1 rounded transition-colors"
|
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'}">
|
th:classappend="${currentPage == pageNum ? 'bg-blue-600 text-white' : 'border border-gray-300 hover:bg-gray-100'}">
|
||||||
@@ -252,7 +205,7 @@
|
|||||||
hx-target="#adherents-table-container"
|
hx-target="#adherents-table-container"
|
||||||
hx-select="#adherents-table-container"
|
hx-select="#adherents-table-container"
|
||||||
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
hx-include="#filter-row input, #filter-row select, input[name='query']"
|
||||||
th:attr="hx-vals=|{"page": ${currentPage + 1}}|"
|
th:attr="hx-vals=|{'page': ${currentPage + 1}}|"
|
||||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
|
||||||
Suivant
|
Suivant
|
||||||
</button>
|
</button>
|
||||||
@@ -264,18 +217,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<script>
|
|
||||||
function updateSort(field) {
|
|
||||||
let sf = document.getElementById('sortField');
|
|
||||||
let sd = document.getElementById('sortDirection');
|
|
||||||
if (sf.value === field) {
|
|
||||||
sd.value = sd.value === 'asc' ? 'desc' : 'asc';
|
|
||||||
} else {
|
|
||||||
sf.value = field;
|
|
||||||
sd.value = 'asc';
|
|
||||||
}
|
|
||||||
sf.dispatchEvent(new Event('change', { bubbles: true }));
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Utilisateurs Connectés - AS Talange</title>
|
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
|
||||||
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
body { font-family: 'Inter', sans-serif; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body class="bg-gray-50 text-gray-900 flex h-screen overflow-hidden">
|
|
||||||
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<div th:replace="~{fragments/sidebar :: sidebar}"></div>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main class="flex-1 flex flex-col h-screen overflow-hidden">
|
|
||||||
<!-- Header -->
|
|
||||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-6">
|
|
||||||
<h2 class="text-lg font-semibold text-gray-800">Utilisateurs Connectés</h2>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Main section -->
|
|
||||||
<div class="flex-1 overflow-auto p-6">
|
|
||||||
<div class="mb-6 flex justify-between items-center">
|
|
||||||
<h3 class="text-xl font-bold text-gray-900">
|
|
||||||
Sessions Actives (<span th:text="${activeCount}">0</span>)
|
|
||||||
</h3>
|
|
||||||
<button hx-get="/admin/sessions" hx-target="body" hx-swap="outerHTML" class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors">
|
|
||||||
Rafraîchir
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
|
||||||
<table class="w-full text-left border-collapse">
|
|
||||||
<thead>
|
|
||||||
<tr class="bg-gray-50 text-gray-500 text-sm uppercase tracking-wider border-b border-gray-200">
|
|
||||||
<th class="py-3 px-6 font-medium text-left">Nom d'utilisateur</th>
|
|
||||||
<th class="py-3 px-6 font-medium text-left">Statut</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="divide-y divide-gray-200 text-sm">
|
|
||||||
<tr th:if="${#lists.isEmpty(activeUsers)}">
|
|
||||||
<td colspan="2" class="py-8 text-center text-gray-500">Aucun utilisateur connecté pour le moment.</td>
|
|
||||||
</tr>
|
|
||||||
<tr th:each="username : ${activeUsers}" class="hover:bg-gray-50 transition-colors">
|
|
||||||
<td class="py-4 px-6 font-medium text-gray-900 flex items-center">
|
|
||||||
<div class="w-8 h-8 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center font-bold mr-3">
|
|
||||||
<span th:text="${#strings.substring(username, 0, 1).toUpperCase()}">U</span>
|
|
||||||
</div>
|
|
||||||
<span th:text="${username}">username</span>
|
|
||||||
</td>
|
|
||||||
<td class="py-4 px-6">
|
|
||||||
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs font-semibold rounded-full">En ligne</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
<div class="pt-4 pb-2 px-3 text-xs font-semibold text-gray-400 uppercase tracking-wider">Administration</div>
|
<div class="pt-4 pb-2 px-3 text-xs font-semibold text-gray-400 uppercase tracking-wider">Administration</div>
|
||||||
<a href="/utilisateurs" th:classappend="${requestURI != null and requestURI.startsWith('/utilisateurs') ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'}" class="block px-3 py-2 rounded-lg transition-colors">Utilisateurs</a>
|
<a href="/utilisateurs" th:classappend="${requestURI != null and requestURI.startsWith('/utilisateurs') ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'}" class="block px-3 py-2 rounded-lg transition-colors">Utilisateurs</a>
|
||||||
<a href="/admin/logs/paiements" th:classappend="${requestURI != null and requestURI.startsWith('/admin/logs/paiements') ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'}" class="block px-3 py-2 rounded-lg transition-colors">Logs Paiements</a>
|
<a href="/admin/logs/paiements" th:classappend="${requestURI != null and requestURI.startsWith('/admin/logs/paiements') ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'}" class="block px-3 py-2 rounded-lg transition-colors">Logs Paiements</a>
|
||||||
<a href="/admin/sessions" th:classappend="${requestURI != null and requestURI.startsWith('/admin/sessions') ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'}" class="block px-3 py-2 rounded-lg transition-colors">Utilisateurs Connectés</a>
|
|
||||||
</th:block>
|
</th:block>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="p-4 border-t border-gray-200">
|
<div class="p-4 border-t border-gray-200">
|
||||||
|
|||||||
@@ -22,10 +22,6 @@
|
|||||||
<form th:action="@{/categories}" th:object="${categorie}" method="post" class="space-y-6">
|
<form th:action="@{/categories}" th:object="${categorie}" method="post" class="space-y-6">
|
||||||
<input type="hidden" th:field="*{id}" />
|
<input type="hidden" th:field="*{id}" />
|
||||||
|
|
||||||
<div th:if="${errorMessage}" class="bg-red-50 border-l-4 border-red-500 p-4 mb-6">
|
|
||||||
<p class="text-sm text-red-700" th:text="${errorMessage}"></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<div class="grid grid-cols-2 gap-4">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Nom (ex: U15)</label>
|
<label class="block text-sm font-medium text-gray-700 mb-1">Nom (ex: U15)</label>
|
||||||
|
|||||||
@@ -56,9 +56,6 @@
|
|||||||
<td class="py-4 px-6 text-right font-medium text-purple-600" th:text="${cat.tarifExterieur != null ? cat.tarifExterieur + ' €' : '-'}">130.00 €</td>
|
<td class="py-4 px-6 text-right font-medium text-purple-600" th:text="${cat.tarifExterieur != null ? cat.tarifExterieur + ' €' : '-'}">130.00 €</td>
|
||||||
<td class="py-4 px-6 text-right flex justify-end space-x-3 items-center">
|
<td class="py-4 px-6 text-right flex justify-end space-x-3 items-center">
|
||||||
<a th:href="@{/categories/{id}/edit(id=${cat.id})}" class="text-indigo-600 hover:text-indigo-900 font-medium bg-indigo-50 px-3 py-1 rounded-lg">Modifier</a>
|
<a th:href="@{/categories/{id}/edit(id=${cat.id})}" class="text-indigo-600 hover:text-indigo-900 font-medium bg-indigo-50 px-3 py-1 rounded-lg">Modifier</a>
|
||||||
<form th:action="@{/categories/{id}/duplicate(id=${cat.id})}" method="post">
|
|
||||||
<button type="submit" class="text-green-600 hover:text-green-800 font-medium bg-green-50 px-3 py-1 rounded-lg">Dupliquer</button>
|
|
||||||
</form>
|
|
||||||
<form th:action="@{/categories/{id}/delete(id=${cat.id})}" method="post" onsubmit="return confirm('Supprimer cette catégorie ?');">
|
<form th:action="@{/categories/{id}/delete(id=${cat.id})}" method="post" onsubmit="return confirm('Supprimer cette catégorie ?');">
|
||||||
<button type="submit" class="text-red-600 hover:text-red-800 font-medium">Supprimer</button>
|
<button type="submit" class="text-red-600 hover:text-red-800 font-medium">Supprimer</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -19,9 +19,6 @@
|
|||||||
|
|
||||||
<div class="flex-1 overflow-auto p-6">
|
<div class="flex-1 overflow-auto p-6">
|
||||||
<div class="max-w-xl mx-auto bg-white rounded-xl shadow-sm border border-gray-100 p-8">
|
<div class="max-w-xl mx-auto bg-white rounded-xl shadow-sm border border-gray-100 p-8">
|
||||||
<div th:if="${errorMessage}" class="bg-red-50 border-l-4 border-red-500 p-4 mb-6">
|
|
||||||
<p class="text-sm text-red-700" th:text="${errorMessage}"></p>
|
|
||||||
</div>
|
|
||||||
<form th:action="@{/equipements}" th:object="${equipement}" method="post" class="space-y-6">
|
<form th:action="@{/equipements}" th:object="${equipement}" method="post" class="space-y-6">
|
||||||
<input type="hidden" th:field="*{id}" />
|
<input type="hidden" th:field="*{id}" />
|
||||||
|
|
||||||
@@ -59,32 +56,8 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Tailles disponibles</label>
|
<label class="block text-sm font-medium text-gray-700 mb-1">Tailles disponibles</label>
|
||||||
|
<input type="text" th:field="*{taillesDisponibles}" placeholder="ex: XS, S, M, L, XL ou 5/6 ANS, 7/8 ANS..." class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||||
<div class="mb-2">
|
<p class="text-xs text-gray-500 mt-1">Séparez les tailles par des virgules. Laissez vide si taille unique ou standard.</p>
|
||||||
<select id="grilleTailles" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none bg-gray-50" onchange="applyGrilleTailles()">
|
|
||||||
<option value="">-- Utiliser une grille prédéfinie --</option>
|
|
||||||
<option value="5/6ANS (Taille 116cm),7/8ANS (Taille 128cm),9/10ANS (Taille 140cm),11/12ANS (Taille 152cm),13/14ANS (Taille 164cm)">Vêtements Junior</option>
|
|
||||||
<option value="XS,S,M,L,XL,XXL">Vêtements Adulte</option>
|
|
||||||
<option value="5/6ANS (Taille 116cm),7/8ANS (Taille 128cm),9/10ANS (Taille 140cm),11/12ANS (Taille 152cm),13/14ANS (Taille 164cm),XS,S,M,L,XL,XXL">Vêtements (Junior + Adulte)</option>
|
|
||||||
<option value="27/30 (Taille 0),31/34 (Taille 1),35/38 (Taille 2),39/42 (Taille 3)">Pointures Junior</option>
|
|
||||||
<option value="35/38 (Taille 2),39/42 (Taille 3),43/46 (Taille 4)">Pointures Adulte</option>
|
|
||||||
<option value="27/30 (Taille 0),31/34 (Taille 1),35/38 (Taille 2),39/42 (Taille 3),43/46 (Taille 4)">Pointures (Junior + Adulte)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="text" id="taillesDisponibles" th:field="*{taillesDisponibles}" placeholder="ex: XS, S, M, L, XL ou 5/6 ANS, 7/8 ANS..." class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
|
||||||
<p class="text-xs text-gray-500 mt-1">Séparez les tailles par des virgules. Vous pouvez utiliser une grille ci-dessus et ajuster manuellement.</p>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function applyGrilleTailles() {
|
|
||||||
const select = document.getElementById('grilleTailles');
|
|
||||||
const input = document.getElementById('taillesDisponibles');
|
|
||||||
if (select.value) {
|
|
||||||
input.value = select.value;
|
|
||||||
select.value = ''; // Reset select after applying
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -94,24 +67,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-4 border-t border-gray-100">
|
|
||||||
<h3 class="text-sm font-medium text-gray-900 mb-4">Options de personnalisation (Flocage)</h3>
|
|
||||||
|
|
||||||
<div class="space-y-4">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<input type="checkbox" th:field="*{hasFlocagePrenom}" class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
|
|
||||||
<label class="ml-2 block text-sm text-gray-700">Flocage : Prénom du joueur</label>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<input type="checkbox" th:field="*{hasFlocageInitiales}" class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
|
|
||||||
<label class="ml-2 block text-sm text-gray-700">Flocage : Initiales du joueur</label>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<input type="checkbox" th:field="*{hasFlocageNumero}" class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
|
|
||||||
<label class="ml-2 block text-sm text-gray-700">Flocage : Numéro</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="pt-4 flex justify-end space-x-3 border-t border-gray-100">
|
<div class="pt-4 flex justify-end space-x-3 border-t border-gray-100">
|
||||||
<a th:href="@{/equipements}" class="px-4 py-2 text-sm font-medium text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50">Annuler</a>
|
<a th:href="@{/equipements}" class="px-4 py-2 text-sm font-medium text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50">Annuler</a>
|
||||||
<button type="submit" class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700">Enregistrer</button>
|
<button type="submit" class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700">Enregistrer</button>
|
||||||
|
|||||||
@@ -44,9 +44,6 @@
|
|||||||
<td class="py-4 px-6 text-gray-600" th:text="${equip.description != null ? equip.description : '-'}">Maillot de match officiel</td>
|
<td class="py-4 px-6 text-gray-600" th:text="${equip.description != null ? equip.description : '-'}">Maillot de match officiel</td>
|
||||||
<td class="py-4 px-6 text-right flex justify-end space-x-3 items-center">
|
<td class="py-4 px-6 text-right flex justify-end space-x-3 items-center">
|
||||||
<a th:href="@{/equipements/{id}/edit(id=${equip.id})}" class="text-indigo-600 hover:text-indigo-900 font-medium bg-indigo-50 px-3 py-1 rounded-lg">Modifier</a>
|
<a th:href="@{/equipements/{id}/edit(id=${equip.id})}" class="text-indigo-600 hover:text-indigo-900 font-medium bg-indigo-50 px-3 py-1 rounded-lg">Modifier</a>
|
||||||
<form th:action="@{/equipements/{id}/duplicate(id=${equip.id})}" method="post">
|
|
||||||
<button type="submit" class="text-green-600 hover:text-green-800 font-medium bg-green-50 px-3 py-1 rounded-lg">Dupliquer</button>
|
|
||||||
</form>
|
|
||||||
<form th:action="@{/equipements/{id}/delete(id=${equip.id})}" method="post" onsubmit="return confirm('Supprimer cet équipement ? Cela supprimera également les dotations associées de toutes les licences.');">
|
<form th:action="@{/equipements/{id}/delete(id=${equip.id})}" method="post" onsubmit="return confirm('Supprimer cet équipement ? Cela supprimera également les dotations associées de toutes les licences.');">
|
||||||
<button type="submit" class="text-red-600 hover:text-red-800 font-medium">Supprimer</button>
|
<button type="submit" class="text-red-600 hover:text-red-800 font-medium">Supprimer</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -55,11 +55,6 @@
|
|||||||
<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)">
|
<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>
|
||||||
|
|
||||||
<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">
|
<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>
|
<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">
|
<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">
|
||||||
@@ -91,11 +86,6 @@
|
|||||||
<li>Pour les adhérents nés à l'étranger : Passeport + justificatif de domicile (du représentant légal en cas de mineur)</li>
|
<li>Pour les adhérents nés à l'étranger : Passeport + justificatif de domicile (du représentant légal en cas de mineur)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<div class="grid grid-cols-2 gap-4">
|
||||||
@@ -162,25 +152,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</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 class="flex items-start pt-2">
|
<div class="flex items-start pt-2">
|
||||||
<div class="flex items-center h-5">
|
<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">
|
<input id="consentementRgpd" name="consentementRgpd" type="checkbox" required class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
|
||||||
@@ -250,29 +221,21 @@
|
|||||||
const ancienClubInput = document.getElementById('ancienClub');
|
const ancienClubInput = document.getElementById('ancienClub');
|
||||||
const ancienneCategorieBlock = document.getElementById('ancienneCategorieBlock');
|
const ancienneCategorieBlock = document.getElementById('ancienneCategorieBlock');
|
||||||
const ancienneCategorieSelect = document.getElementById('ancienneCategorie');
|
const ancienneCategorieSelect = document.getElementById('ancienneCategorie');
|
||||||
const raisonChangementClubBlock = document.getElementById('raisonChangementClubBlock');
|
|
||||||
const raisonChangementClubInput = document.getElementById('raisonChangementClub');
|
|
||||||
|
|
||||||
if (ancienClubInput) {
|
if (ancienClubInput) {
|
||||||
ancienClubInput.addEventListener('input', function() {
|
ancienClubInput.addEventListener('input', function() {
|
||||||
if (this.value.trim().length > 0) {
|
if (this.value.trim().length > 0) {
|
||||||
ancienneCategorieBlock.classList.remove('hidden');
|
ancienneCategorieBlock.classList.remove('hidden');
|
||||||
ancienneCategorieSelect.required = true;
|
ancienneCategorieSelect.required = true;
|
||||||
raisonChangementClubBlock.classList.remove('hidden');
|
|
||||||
raisonChangementClubInput.required = true;
|
|
||||||
} else {
|
} else {
|
||||||
ancienneCategorieBlock.classList.add('hidden');
|
ancienneCategorieBlock.classList.add('hidden');
|
||||||
ancienneCategorieSelect.required = false;
|
ancienneCategorieSelect.required = false;
|
||||||
raisonChangementClubBlock.classList.add('hidden');
|
|
||||||
raisonChangementClubInput.required = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Initial check
|
// Initial check
|
||||||
if (ancienClubInput.value.trim().length > 0) {
|
if (ancienClubInput.value.trim().length > 0) {
|
||||||
ancienneCategorieBlock.classList.remove('hidden');
|
ancienneCategorieBlock.classList.remove('hidden');
|
||||||
ancienneCategorieSelect.required = true;
|
ancienneCategorieSelect.required = true;
|
||||||
raisonChangementClubBlock.classList.remove('hidden');
|
|
||||||
raisonChangementClubInput.required = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<groupId>com.astalange</groupId>
|
<groupId>com.astalange</groupId>
|
||||||
<artifactId>as-talange-parent</artifactId>
|
<artifactId>as-talange-parent</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.4</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>as-talange-parent</name>
|
<name>as-talange-parent</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user