Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (7)
added Dockerfile
· c9b79dd7
Elly Smagghe
authored
Nov 13, 2023
c9b79dd7
Merge origin/master
· 462d76db
Elly Smagghe
authored
Nov 13, 2023
462d76db
trié croisé works but if all params are chosen.. not work yet if one param is not chosen
· a7692548
Elly Smagghe
authored
Nov 16, 2023
a7692548
trie croisé marche
· bc19b97c
Elly Smagghe
authored
Nov 16, 2023
bc19b97c
trim some unused files
· 0878b77c
Elly Smagghe
authored
Nov 16, 2023
0878b77c
Merge FiltreCroisee
· 10065f74
Elly Smagghe
authored
Nov 16, 2023
10065f74
add link Fiche Pilote to Filter Pilote
· bca20842
Elly Smagghe
authored
Nov 16, 2023
bca20842
Show whitespace changes
Inline
Side-by-side
Dockerfile
0 → 100644
View file @
bca20842
FROM
openjdk:17
LABEL
maintainer="ellyfiah@gmail.com"
COPY
target/starWars-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT
["java","-jar","/app.jar"]
src/main/java/fr/ldnr/starWars/controllers/
Lis
tePiloteController.java
→
src/main/java/fr/ldnr/starWars/controllers/
Fil
te
r
PiloteController.java
View file @
bca20842
...
...
@@ -4,6 +4,10 @@
*/
package
fr.ldnr.starWars.controllers
;
import
fr.ldnr.starWars.domains.PiloteSpecifications
;
import
fr.ldnr.starWars.enumerations.EtatPilote
;
import
fr.ldnr.starWars.enumerations.GradePilote
;
import
fr.ldnr.starWars.enumerations.RacePilote
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
fr.ldnr.starWars.services.PiloteService
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -17,34 +21,45 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author stag
*/
@Controller
public
class
Lis
tePiloteController
{
public
class
Fil
te
r
PiloteController
{
private
final
PiloteService
piloteService
;
public
Lis
tePiloteController
(
PiloteService
piloteService
)
{
public
Fil
te
r
PiloteController
(
PiloteService
piloteService
)
{
this
.
piloteService
=
piloteService
;
}
@GetMapping
(
"/listePilote"
)
public
String
listePilote
(
Model
model
)
{
model
.
addAttribute
(
"pilotes"
,
piloteService
.
findAll
());
model
.
addAttribute
(
"typePilotes"
,
piloteService
.
listType
());
model
.
addAttribute
(
"gradePilotes"
,
piloteService
.
listGrade
());
@GetMapping
(
"/filterPilote"
)
public
String
filterPilote
(
Model
model
)
{
model
.
addAttribute
(
"etatPilotes"
,
piloteService
.
listEtat
());
model
.
addAttribute
(
"gradePilotes"
,
piloteService
.
listGrade
());
model
.
addAttribute
(
"typePilotes"
,
piloteService
.
listType
());
model
.
addAttribute
(
"racePilotes"
,
piloteService
.
listRace
());
return
"filterPilote"
;
}
@PostMapping
(
"/filterPilote"
)
public
String
filterPilote
(
Model
model
,
@RequestParam
(
value
=
"etatPilotes"
,
required
=
false
)
String
etatPilote
,
@RequestParam
(
value
=
"gradePilotes"
,
required
=
false
)
String
gradePilote
,
@RequestParam
(
value
=
"typePilotes"
,
required
=
false
)
String
typePilote
,
@RequestParam
(
value
=
"racePilotes"
,
required
=
false
)
String
racePilote
)
{
// Validate the parameters if needed
EtatPilote
etat
=
(
etatPilote
.
equals
(
"none"
))
?
null
:
EtatPilote
.
valueOf
(
etatPilote
);
GradePilote
grade
=
(
gradePilote
.
equals
(
"none"
))
?
null
:
GradePilote
.
valueOf
(
gradePilote
);
TypePilote
type
=
(
typePilote
.
equals
(
"none"
))
?
null
:
TypePilote
.
valueOf
(
typePilote
);
RacePilote
race
=
(
racePilote
.
equals
(
"none"
))
?
null
:
RacePilote
.
valueOf
(
racePilote
);
System
.
out
.
println
(
"etat"
+
etat
);
model
.
addAttribute
(
"pilotes"
,
piloteService
.
findAll
(
PiloteSpecifications
.
findByParameters
(
etat
,
grade
,
type
,
race
)));
System
.
out
.
println
(
"pilotes filtered : "
+
piloteService
.
findAll
(
PiloteSpecifications
.
findByParameters
(
etat
,
grade
,
type
,
race
)));
model
.
addAttribute
(
"etatPilotes"
,
piloteService
.
listEtat
());
model
.
addAttribute
(
"gradePilotes"
,
piloteService
.
listGrade
());
model
.
addAttribute
(
"typePilotes"
,
piloteService
.
listType
());
model
.
addAttribute
(
"racePilotes"
,
piloteService
.
listRace
());
return
"
lis
tePilote"
;
return
"
fil
te
r
Pilote"
;
}
// @PostMapping("/listePilote")
// public String listePilote(Model model,
// @RequestParam(value = "typePilotes") String types,
// @RequestParam(value = "gradePilotes") String grades,
// @RequestParam(value = "etatPilotes") String etats,
// @RequestParam(value = "racePilotes") String races) {
// model.addAttribute("pilotes", piloteService.listType());
// model.addAttribute("typePilotes", piloteService.findByType(TypePilote.valueOf(types)));
// return "listePilote";
// }
}
src/main/java/fr/ldnr/starWars/controllers/ListePiloteParEtat.java
deleted
100644 → 0
View file @
b6d728fb
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
fr.ldnr.starWars.controllers
;
import
fr.ldnr.starWars.enumerations.EtatPilote
;
import
fr.ldnr.starWars.enumerations.GradePilote
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
fr.ldnr.starWars.services.PiloteService
;
import
java.util.ArrayList
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
*
* @author stag
*/
@Controller
public
class
ListePiloteParEtat
{
private
final
PiloteService
piloteService
;
public
ListePiloteParEtat
(
PiloteService
piloteService
)
{
this
.
piloteService
=
piloteService
;
}
@GetMapping
(
"/listePiloteParEtat"
)
public
String
listePilote
(
Model
model
)
{
model
.
addAttribute
(
"etats"
,
piloteService
.
listEtat
());
return
"listePiloteParEtat"
;
}
@PostMapping
(
"/listePiloteParEtat"
)
public
String
listePilote
(
Model
model
,
@RequestParam
(
value
=
"etats"
)
String
etats
)
{
model
.
addAttribute
(
"etats"
,
piloteService
.
listEtat
());
// if (types.equals("all")) {
// model.addAttribute("pilotes", piloteService.findAll());
// }
model
.
addAttribute
(
"pilotes"
,
piloteService
.
findByEtat
(
EtatPilote
.
valueOf
(
etats
)));
return
"listePiloteParEtat"
;
}
}
src/main/java/fr/ldnr/starWars/controllers/ListePiloteParGrade.java
deleted
100644 → 0
View file @
b6d728fb
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
fr.ldnr.starWars.controllers
;
import
fr.ldnr.starWars.enumerations.GradePilote
;
import
fr.ldnr.starWars.services.PiloteService
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
*
* @author stag
*/
@Controller
public
class
ListePiloteParGrade
{
private
final
PiloteService
piloteService
;
public
ListePiloteParGrade
(
PiloteService
piloteService
)
{
this
.
piloteService
=
piloteService
;
}
@GetMapping
(
"/listePiloteParGrade"
)
public
String
listePilote
(
Model
model
)
{
model
.
addAttribute
(
"grades"
,
piloteService
.
listGrade
());
return
"listePiloteParGrade"
;
}
@PostMapping
(
"/listePiloteParGrade"
)
public
String
listePilote
(
Model
model
,
@RequestParam
(
value
=
"grades"
)
String
grades
)
{
model
.
addAttribute
(
"grades"
,
piloteService
.
listGrade
());
// if (types.equals("all")) {
// model.addAttribute("pilotes", piloteService.findAll());
// }
model
.
addAttribute
(
"pilotes"
,
piloteService
.
findByGrade
(
GradePilote
.
valueOf
(
grades
)));
return
"listePiloteParGrade"
;
}
}
src/main/java/fr/ldnr/starWars/controllers/ListePiloteParType.java
deleted
100644 → 0
View file @
b6d728fb
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
fr.ldnr.starWars.controllers
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
fr.ldnr.starWars.services.PiloteService
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
*
* @author stag
*/
@Controller
public
class
ListePiloteParType
{
private
final
PiloteService
piloteService
;
public
ListePiloteParType
(
PiloteService
piloteService
)
{
this
.
piloteService
=
piloteService
;
}
@GetMapping
(
"/listePiloteParType"
)
public
String
listePilote
(
Model
model
)
{
model
.
addAttribute
(
"types"
,
piloteService
.
listType
());
return
"listePiloteParType"
;
}
@PostMapping
(
"/listePiloteParType"
)
public
String
listePilote
(
Model
model
,
@RequestParam
(
value
=
"types"
)
String
types
)
{
model
.
addAttribute
(
"types"
,
piloteService
.
listType
());
// if (types.equals("all")) {
// model.addAttribute("pilotes", piloteService.findAll());
// }
model
.
addAttribute
(
"pilotes"
,
piloteService
.
findByType
(
TypePilote
.
valueOf
(
types
)));
return
"listePiloteParType"
;
}
}
src/main/java/fr/ldnr/starWars/domains/PiloteSpecifications.java
0 → 100644
View file @
bca20842
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
fr.ldnr.starWars.domains
;
import
fr.ldnr.starWars.enumerations.EtatPilote
;
import
fr.ldnr.starWars.enumerations.GradePilote
;
import
fr.ldnr.starWars.enumerations.RacePilote
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
jakarta.persistence.criteria.CriteriaBuilder
;
import
jakarta.persistence.criteria.Path
;
import
jakarta.persistence.criteria.Predicate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.data.jpa.domain.Specification
;
/**
*
* @author stag
*/
public
class
PiloteSpecifications
{
public
static
Specification
<
Pilote
>
findByParameters
(
EtatPilote
etat
,
GradePilote
grade
,
TypePilote
type
,
RacePilote
race
)
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
List
<
Predicate
>
predicates
=
new
ArrayList
<>();
if
(
etat
!=
null
)
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"etat"
),
etat
));
}
if
(
grade
!=
null
)
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"grade"
),
grade
));
}
if
(
type
!=
null
)
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"type"
),
type
));
}
if
(
race
!=
null
)
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"race"
),
race
));
}
return
criteriaBuilder
.
and
(
predicates
.
toArray
(
new
Predicate
[
0
]));
};
}
}
src/main/java/fr/ldnr/starWars/repositories/PiloteRepository.java
View file @
bca20842
...
...
@@ -10,6 +10,7 @@ import fr.ldnr.starWars.enumerations.GradePilote;
import
fr.ldnr.starWars.enumerations.RacePilote
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
java.util.List
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -36,4 +37,6 @@ public interface PiloteRepository extends CrudRepository<Pilote, Long> {
//List<Pilote> findByEtatInAndTypeIn(List<EtatPilote> etats, List<TypePilote> types);
List
<
Pilote
>
findByEtatAndType
(
EtatPilote
etat
,
TypePilote
type
);
List
<
Pilote
>
findAll
(
Specification
<
Pilote
>
spec
);
}
src/main/java/fr/ldnr/starWars/services/PiloteService.java
View file @
bca20842
...
...
@@ -10,6 +10,7 @@ import fr.ldnr.starWars.enumerations.GradePilote;
import
fr.ldnr.starWars.enumerations.RacePilote
;
import
fr.ldnr.starWars.enumerations.TypePilote
;
import
java.util.List
;
import
org.springframework.data.jpa.domain.Specification
;
/**
*
...
...
@@ -45,4 +46,6 @@ public interface PiloteService {
public
Pilote
findById
(
Integer
id_pilote
);
public
List
<
Pilote
>
findAll
(
Specification
<
Pilote
>
spec
);
}
src/main/java/fr/ldnr/starWars/services/PiloteServiceImpl.java
View file @
bca20842
...
...
@@ -5,6 +5,7 @@
package
fr.ldnr.starWars.services
;
import
fr.ldnr.starWars.domains.Pilote
;
import
fr.ldnr.starWars.domains.PiloteSpecifications
;
import
fr.ldnr.starWars.enumerations.EtatPilote
;
import
fr.ldnr.starWars.enumerations.GradePilote
;
import
fr.ldnr.starWars.enumerations.RacePilote
;
...
...
@@ -14,6 +15,8 @@ import jakarta.persistence.EntityManager;
import
jakarta.persistence.PersistenceContext
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.springframework.data.jpa.domain.Specification
;
import
static
org
.
springframework
.
data
.
util
.
TypeUtils
.
type
;
import
org.springframework.stereotype.Service
;
/**
...
...
@@ -82,6 +85,7 @@ public class PiloteServiceImpl implements PiloteService {
public
List
<
Pilote
>
findByNom
(
String
nom
)
{
return
piloteRepository
.
findByNom
(
nom
);
}
@Override
public
List
<
Pilote
>
findByNomAndPrenom
(
String
nom
,
String
prenom
)
{
return
piloteRepository
.
findByNomAndPrenom
(
nom
,
prenom
);
...
...
@@ -107,4 +111,9 @@ public class PiloteServiceImpl implements PiloteService {
return
piloteRepository
.
findByEtatAndType
(
etat
,
type
);
}
@Override
public
List
<
Pilote
>
findAll
(
Specification
<
Pilote
>
spec
)
{
return
piloteRepository
.
findAll
(
spec
);
}
}
src/main/resources/templates/
lis
tePilote.html
→
src/main/resources/templates/
fil
te
r
Pilote.html
View file @
bca20842
...
...
@@ -5,7 +5,7 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
liste p
ilote
</title>
<title>
Filter P
ilote
</title>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<link
rel=
"stylesheet"
href=
"/style.css"
/>
...
...
@@ -16,14 +16,41 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
</head>
<body>
<header>
<h1>
Trier
des Pilotes
</h1>
<h1>
<span
class=
'faulty-letter'
>
{
</span>
Liste
des Pilotes
par Tri
</h1>
</header>
<main>
<div
class=
"tri"
>
<a
th:href=
"@{/listePiloteParType}"
><p>
Trier par rang
</p></a>
<a
th:href=
"@{/listePiloteParGrade}"
><p>
Trier par grade
</p></a>
<a
th:href=
"@{/listePiloteParEtat}"
><p>
Trier par etat
</p></a>
<form
action=
"/filterPilote"
method=
"post"
>
<div>
<label
for=
"etatPilotes"
>
Choisir un etat :
</label>
<select
id=
"etatPilotes"
name=
"etatPilotes"
>
<option
value=
"none"
>
Tous
</option>
<option
th:each=
"etatPilote : ${etatPilotes}"
th:value=
"${etatPilote}"
th:text=
"${etatPilote}"
></option>
</select>
</div>
<div>
<label
for=
"gradePilotes"
>
Choisir un grade :
</label>
<select
id=
"gradePilotes"
name=
"gradePilotes"
>
<option
value=
"none"
>
Tous
</option>
<option
th:each=
"gradePilote : ${gradePilotes}"
th:value=
"${gradePilote}"
th:text=
"${gradePilote}"
></option>
</select>
</div>
<div>
<label
for=
"typePilotes"
>
Choisir un type :
</label>
<select
id=
"typePilotes"
name=
"typePilotes"
>
<option
value=
"none"
>
Tous
</option>
<option
th:each=
"typePilote : ${typePilotes}"
th:value=
"${typePilote}"
th:text=
"${typePilote}"
></option>
</select>
</div>
<div>
<label
for=
"racePilotes"
>
Choisir une race :
</label>
<select
id=
"racePilotes"
name=
"racePilotes"
>
<option
value=
"none"
>
Tous
</option>
<option
th:each=
"racePilote : ${racePilotes}"
th:value=
"${racePilote}"
th:text=
"${racePilote}"
></option>
</select>
</div>
<input
type=
"submit"
value=
"Trier"
/>
<input
type=
"reset"
value=
"Annuler"
/>
</form>
<table>
<tr>
...
...
@@ -49,7 +76,7 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<td
th:text=
"${pilote.type}"
></td>
<td
th:text=
"${pilote.etat}"
></td>
<td>
<a
th:href=
"'/fichePilote?id_pilote=' + ${pilote.idPilote}"
th:text=
"Fiche_
Pilote
"
>
<a
th:href=
"'/fichePilote?id_pilote=' + ${pilote.idPilote}"
th:text=
"Fiche_
Chasseur
"
>
</a>
</td>
</tr>
...
...
src/main/resources/templates/listePiloteParEtat.html
deleted
100644 → 0
View file @
b6d728fb
<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
Liste Pilote
</title>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<link
rel=
"stylesheet"
href=
"/style.css"
/>
<link
href=
"https://fonts.cdnfonts.com/css/star-wars"
rel=
"stylesheet"
>
<style>
@import
url('https://fonts.cdnfonts.com/css/star-wars')
;
</style>
</head>
<body>
<header>
<h1><span
class=
'faulty-letter'
>
{
</span>
Liste des pilotes par etat
</h1>
</header>
<main>
<form
action=
"/listePiloteParEtat"
method=
"post"
>
<div>
<label
for=
"etats"
>
Choisir un etat :
</label>
<select
id=
"etats"
name=
"etats"
>
<option
th:each=
"etat : ${etats}"
th:value=
"${etat}"
th:text=
"${etat}"
></option>
</select>
<input
type=
"submit"
value=
"Trier"
/>
</div>
</form>
<table>
<tr>
<th>
Id pilote
</th>
<th>
Nom
</th>
<th>
Prenom
</th>
<th>
Age
</th>
<th>
Race
</th>
<th>
Grade
</th>
<th>
Type
</th>
<th>
Etat
</th>
</tr>
<tr
th:each=
"pilote : ${pilotes}"
>
<td>
<a
th:href=
"'/fichePilote?id_pilote=' + ${pilote.idPilote}"
th:text=
"${pilote.idPilote}"
>
</a>
</td>
<td
th:text=
"${pilote.nom}"
></td>
<td
th:text=
"${pilote.prenom}"
></td>
<td
th:text=
"${pilote.age}"
></td>
<td
th:text=
"${pilote.race}"
></td>
<td
th:text=
"${pilote.grade}"
></td>
<td
th:text=
"${pilote.type}"
></td>
<td
th:text=
"${pilote.etat}"
></td>
</tr>
</table>
<p>
<a
href=
"/listePilote"
>
Retour aux pilotes
</a>
</p>
</main>
<footer>
<a
href=
"/menu"
class=
"menu"
>
Retour au Menu
</a>
</footer>
</body>
</html>
src/main/resources/templates/listePiloteParGrade.html
deleted
100644 → 0
View file @
b6d728fb
<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
TODO supply a title
</title>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<link
rel=
"stylesheet"
href=
"/style.css"
/>
<link
href=
"https://fonts.cdnfonts.com/css/star-wars"
rel=
"stylesheet"
>
<style>
@import
url('https://fonts.cdnfonts.com/css/star-wars')
;
</style>
</head>
<body>
<header>
<h1><span
class=
'faulty-letter'
>
{
</span>
Liste des pilotes par grades
</h1>
</header>
<main>
<form
action=
"/listePiloteParGrade"
method=
"post"
>
<div>
<label
for=
"grades"
>
Choisir un grade :
</label>
<select
id=
"grades"
name=
"grades"
>
<option
th:each=
"grade : ${grades}"
th:value=
"${grade}"
th:text=
"${grade}"
></option>
</select>
<input
type=
"submit"
value=
"Trier"
/>
</div>
</form>
<table>
<tr>
<th>
Id pilote
</th>
<th>
Nom
</th>
<th>
Prenom
</th>
<th>
Age
</th>
<th>
Race
</th>
<th>
Grade
</th>
<th>
Type
</th>
<th>
Etat
</th>
</tr>
<tr
th:each=
"pilote : ${pilotes}"
>
<td>
<a
th:href=
"'/fichePilote?id_pilote=' + ${pilote.idPilote}"
th:text=
"${pilote.idPilote}"
>
</a>
</td>
<td
th:text=
"${pilote.nom}"
></td>
<td
th:text=
"${pilote.prenom}"
></td>
<td
th:text=
"${pilote.age}"
></td>
<td
th:text=
"${pilote.race}"
></td>
<td
th:text=
"${pilote.grade}"
></td>
<td
th:text=
"${pilote.type}"
></td>
<td
th:text=
"${pilote.etat}"
></td>
</tr>
</table>
<p>
<a
href=
"/listePilote"
>
retour aux pilotes
</a>
</p>
</main>
<footer>
<a
href=
"/menu"
class=
"menu"
>
Retour au Menu
</a>
</footer>
</body>
</html>
src/main/resources/templates/listePiloteParType.html
deleted
100644 → 0
View file @
b6d728fb
<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
TODO supply a title
</title>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<link
rel=
"stylesheet"
href=
"/style.css"
/>
<link
href=
"https://fonts.cdnfonts.com/css/star-wars"
rel=
"stylesheet"
>
<style>
@import
url('https://fonts.cdnfonts.com/css/star-wars')
;
</style>
</head>
<body>
<header>
<h1><span
class=
'faulty-letter'
>
{
</span>
Liste des pilotes par rang
</h1>
</header>
<main>
<form
action=
"/listePiloteParType"
method=
"post"
>
<div>
<label
for=
"types"
>
choisir un rang :
</label>
<select
id=
"types"
name=
"types"
>
<option
th:each=
"type : ${types}"
th:value=
"${type}"
th:text=
"${type}"
></option>
</select>
<input
type=
"submit"
value=
"Trier"
/>
</div>
</form>
<table>
<tr>
<th>
Id pilote
</th>
<th>
Nom
</th>
<th>
Prenom
</th>
<th>
Age
</th>
<th>
Race
</th>
<th>
Grade
</th>
<th>
Type
</th>
<th>
Etat
</th>
</tr>
<tr
th:each=
"pilote : ${pilotes}"
>
<td>
<a
th:href=
"'/fichePilote?id_pilote=' + ${pilote.idPilote}"
th:text=
"${pilote.idPilote}"
>
</a>
</td>
<td
th:text=
"${pilote.nom}"
></td>
<td
th:text=
"${pilote.prenom}"
></td>
<td
th:text=
"${pilote.age}"
></td>
<td
th:text=
"${pilote.race}"
></td>
<td
th:text=
"${pilote.grade}"
></td>
<td
th:text=
"${pilote.type}"
></td>
<td
th:text=
"${pilote.etat}"
></td>
</tr>
</table>
<p>
<a
href=
"/listePilote"
>
Retour aux pilotes
</a>
</p>
</main>
<footer>
<a
href=
"/menu"
class=
"menu"
>
Retour au Menu
</a>
</footer>
</body>
</html>
src/main/resources/templates/menu.html
View file @
bca20842
...
...
@@ -21,7 +21,7 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<h2>
Pilote
</h2>
<ul>
<li><a
href=
"/inscriptionPilote"
class=
"menu"
>
Inscription d'un nouveau pilote
</a></li>
<li><a
href=
"/
lis
tePilote"
class=
"menu"
>
Liste des pilotes
</a></li>
<li><a
href=
"/
fil
te
r
Pilote"
class=
"menu"
>
Liste des pilotes
</a></li>
<li><a
href=
"/cherchePilote"
class=
"menu"
>
Cherche pilote par nom
</a></li>
</ul>
...
...
src/main/resources/templates/modifierEtatChasseur.html
deleted
100644 → 0
View file @
b6d728fb
<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
Modifier Etat Chasseur
</title>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<link
rel=
"stylesheet"
href=
"/style.css"
>
</head>
<body>
<h1><span
class=
'faulty-letter'
>
{
</span>
Modifier Etat Chasseur
</h1>
<form
action=
"/modifierEtatChasseur"
method=
"post"
>
<div>
<label
for=
"etat"
>
Etat du chasseur
</label>
<select
id=
"etat"
name=
"etat"
>
<option
th:each=
"chasseur : ${chasseur}"
th:value=
"${chasseur.etat}"
th:text=
"${chasseur.etat}"
></option>
</select>
</div>
<input
type=
"submit"
value=
"Modifier"
/>
</form>
<a
th:href=
"@{/listeChasseur}"
>
Retour à la liste des chasseurs
</a>
</body>
</html>