Ajout article v2
This commit is contained in:
@@ -42,7 +42,7 @@ public class ArticleController {
|
||||
}
|
||||
|
||||
@GetMapping("/new")
|
||||
public String test(@PathVariable(name = "slug")int id, Model model) {
|
||||
public String test(Model model) {
|
||||
model.addAttribute("categories", categorieService.findAllCategories());
|
||||
return "newArticle";
|
||||
}
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
<div>
|
||||
<label for="categorie">Catégorie:</label>
|
||||
<select id="categorie" name="categorie" required>
|
||||
<option value="categorie1">Catégorie 1</option>
|
||||
<option value="categorie2">Catégorie 2</option>
|
||||
<!-- Ajoutez d'autres options si nécessaire -->
|
||||
<!-- Boucle sur les catégories pour générer les options -->
|
||||
<option value="">Sélectionnez une catégorie</option>
|
||||
<th:block th:each="categorie : ${categories}">
|
||||
<option th:value="${categorie.id}" th:text="${categorie.libelle}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +56,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Lieu de retrait -->
|
||||
<h2>Retrait</h2>
|
||||
<h4>Retrait</h4>
|
||||
<div>
|
||||
<label for="rue">Rue:</label>
|
||||
<input type="text" id="rue" name="rue" required>
|
||||
|
||||
Reference in New Issue
Block a user