merge conflict

This commit is contained in:
Parpaillax
2024-04-26 15:45:31 +02:00
6 changed files with 207 additions and 161 deletions

View File

@@ -1,14 +1,29 @@
home.search.title = Rechercher un article par nom... home.search.title = Rechercher un article par nom...
home.search.cat = Toutes les cat\u00e9gories home.search.cat = Toutes les cat\u00e9gories
home.search.button = Recherche home.search.button = Recherche
home.buy.title = Achats
home.buy.open = Ench\u00e8res ouvertes
home.buy.progress = Mes ench\u00E8res en cours
home.buy.success = Mes ench\u00E8res remport\u00e9es
home.sell.title = Mes Ventes
home.sell.progress = Mes ventes en cours
home.sell.nostarted = Mes ventes non d\u00e9but\u00e9es
home.sell.finish = Mes ventes termin\u00E9es
home.button.search = Recherche
home.button.lang = Switch to English home.button.lang = Switch to English
home.button.lang2 = FR home.button.lang2 = FR
home.credit = Mes cr\u00e9dits : home.credit = Mes cr\u00e9dits :
home.nav.enchere = Encheres home.nav.enchere = Encheres
home.nav.vend = Vendre un article home.nav.vend = Vendre un article
home.nav.login= S'inscrire / Se connecter home.nav.login = S'inscrire / Se connecter
home.profil.profil = Profil home.profil.profil = Profil
home.profil.logout = D\u00e9connexion home.profil.logout = D\u00e9connexion
home.article.sellprice = Prix de vente:
home.article.seller = Vendeur:
home.article.end = Fin de l'ench\u00E8re:
footer.desc = Cr\u00e9\u00e9e par l'association "Les objets sont nos amis", ENI-Ench\u00e9res a pour objectif d'aider ses membres \u00E0 vendre ou acheter des objets de tout genre.
footer.
profil.title = Mon profile profil.title = Mon profile
profil.button = Modifier profil.button = Modifier
@@ -53,4 +68,52 @@ register.confirm_password.label = Confirmation du mot de passe:
register.submit_button = Cr\u00E9er register.submit_button = Cr\u00E9er
register.cancel_button = Annuler register.cancel_button = Annuler
admin.panel.title = Panel administrateur
admin.categories.title = Liste des cat\u00E9gories modifi\u00E9es
admin.categories.table.name = Nom
admin.categories.table.action = Action
admin.categories.table.save = Enregistrer
admin.categories.table.delete = Supprimer
admin.categories.table.add = Ajouter
admin.users.title = Liste des utilisateurs
admin.users.table.id = ID
admin.users.table.username = Pseudo
admin.users.table.lastname = Nom
admin.users.table.firstname = Pr\u00E9nom
admin.users.table.email = Email
admin.users.table.disable = D\u00E9sactiver
admin.users.table.delete = Supprimer
article.add.title = Ajouter un article
article.add.heading = Nouvelle vente
article.add.form.label.name = Article:
article.add.form.label.description = Description:
article.add.form.label.category = Cat\u00E9gorie:
article.add.form.label.photo = Photo de l'article:
article.add.form.label.starting_price = Mise \u00E0 prix:
article.add.form.label.start_date = Date d\u00E9but ench\u00E8re:
article.add.form.label.end_date = Date fin ench\u00E8re:
article.add.form.label.removal = Retrait
article.add.form.label.street = Rue:
article.add.form.label.postal_code = Code postal:
article.add.form.label.city = Ville:
article.add.form.validation.required = Ce champ est requis.
article.add.form.validation.category = Veuillez s\u00E9lectionner une cat\u00E9gorie.
article.add.form.button.save = Enregistrer
article.add.form.button.cancel = Annuler
article.details.title = Article - NOMARTICLE
article.details.heading = Article
article.details.label.description = Description
article.details.label.seller = Vendeur
article.details.label.category = Cat\u00E9gorie
article.details.label.sale_price = Prix de vente
article.details.label.end_date = Date fin ench\u00E8re
article.details.label.pickup = Retrait
article.details.label.amount = Montant
article.details.button.bid = Ench\u00E9rir
article.details.address.unknown = Adresse inconnue
article.details.validation.amount.required = Le montant de l'ench\u00E8re est requis.
edit.article.title = Modifier mon article edit.article.title = Modifier mon article

View File

@@ -52,22 +52,22 @@
<div class="mb-3"> <div class="mb-3">
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="typeTransaction" id="achats" value="achats" onchange="toggleCheckbox(this.value)"> <input class="form-check-input" type="radio" name="typeTransaction" id="achats" value="achats" onchange="toggleCheckbox(this.value)">
<label class="form-check-label" for="achats">Achats</label> <label class="form-check-label" for="achats" th:text="#{home.sell.title}"></label>
</div> </div>
</div> </div>
<!-- Checkboxes pour Achats --> <!-- Checkboxes pour Achats -->
<div id="achatsOptions"> <div id="achatsOptions">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" name="achatOption" id="encheresOuvertes" th:value="encheresOuvertes" disabled> <input class="form-check-input" type="checkbox" name="achatOption" id="encheresOuvertes" th:value="encheresOuvertes" disabled>
<label class="form-check-label" for="encheresOuvertes">Enchères ouvertes</label> <label class="form-check-label" for="encheresOuvertes" th:text="#{home.buy.open}"></label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" name="achatOption" id="enchereEnCours" th:value="enchereEnCours" disabled> <input class="form-check-input" type="checkbox" name="achatOption" id="enchereEnCours" th:value="enchereEnCours" disabled>
<label class="form-check-label" for="enchereEnCours">Mes enchères en cours</label> <label class="form-check-label" for="enchereEnCours" th:text="#{home.buy.progress}"></label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" name="achatOption" id="enchereRemportees" th:value="enchereRemportees" disabled> <input class="form-check-input" type="checkbox" name="achatOption" id="enchereRemportees" th:value="enchereRemportees" disabled>
<label class="form-check-label" for="enchereRemportees">Mes enchères remportées</label> <label class="form-check-label" for="enchereRemportees" th:text="#{home.buy.success}"></label>
</div> </div>
</div> </div>
</div> </div>
@@ -76,22 +76,22 @@
<div class="mb-3"> <div class="mb-3">
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="typeTransaction" id="ventes" value="ventes" onchange="toggleCheckbox(this.value)"> <input class="form-check-input" type="radio" name="typeTransaction" id="ventes" value="ventes" onchange="toggleCheckbox(this.value)">
<label class="form-check-label" for="ventes">Mes Ventes</label> <label class="form-check-label" for="ventes" th:text="#{home.sell.title}"></label>
</div> </div>
</div> </div>
<!-- Checkboxes pour Ventes --> <!-- Checkboxes pour Ventes -->
<div id="ventesOptions"> <div id="ventesOptions">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" th:name="venteOption" id="venteEnCours" th:value="venteEnCours" disabled> <input class="form-check-input" type="checkbox" th:name="venteOption" id="venteEnCours" th:value="venteEnCours" disabled>
<label class="form-check-label" for="venteEnCours">Mes ventes en cours</label> <label class="form-check-label" for="venteEnCours" th:text="#{home.sell.progress}"></label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" th:name="venteOption" id="ventesNonDebutees" th:value="ventesNonDebutees" disabled> <input class="form-check-input" type="checkbox" th:name="venteOption" id="ventesNonDebutees" th:value="ventesNonDebutees" disabled>
<label class="form-check-label" for="ventesNonDebutees">Mes ventes non débutées</label> <label class="form-check-label" for="ventesNonDebutees" th:text="#{home.sell.nostarted}"></label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" th:name="venteOption" id="ventesTerminees" th:value="ventesTerminees" disabled> <input class="form-check-input" type="checkbox" th:name="venteOption" id="ventesTerminees" th:value="ventesTerminees" disabled>
<label class="form-check-label" for="ventesTerminees">Mes ventes terminées</label> <label class="form-check-label" for="ventesTerminees" th:text="#{home.sell.finish}"></label>
</div> </div>
</div> </div>
</div> </div>
@@ -108,7 +108,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12 col-12 d-flex justify-content-center align-items-center"> <div class="col-md-12 col-12 d-flex justify-content-center align-items-center">
<button type="submit" style="font-size: 1em;" class="btn btn-primary btn-lg w-100">Recherche</button> <button type="submit" style="font-size: 1em;" class="btn btn-primary btn-lg w-100" th:text="#{home.button.search}"></button>
</div> </div>
</div> </div>
</form> </form>
@@ -126,16 +126,16 @@
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<div class="card-body d-flex flex-column "> <div class="card-body d-flex flex-column ">
<h5 class="text-dark card-title text" th:text="${article.nom}">Nom de l'article</h5> <h5 class="text-dark card-title text" th:text="${article.nom}"></h5>
<p class="text-dark card-text mb-auto" th:text="${article.desc}">Description</p> <p class="text-dark card-text mb-auto" th:text="${article.desc}"></p>
<div class="text-dark d-flex justify-content-between align-items-center"> <div class="text-dark d-flex justify-content-between align-items-center">
<div> <div>
<h6>Prix de vente: <span th:text="${article.prixVente}"></span></h6> <h6 th:text="#{home.article.sellprice}"> <span th:text="${article.prixVente}"></span></h6>
<h6>Vendeur: <span th:text="${article.pseudoUtilisateur}"></span> </h6> <h6 th:text="#{home.article.seller}"> <span th:text="${article.pseudoUtilisateur}"></span> </h6>
</div> </div>
</div> </div>
<br> <br>
<h6 class="text-muted">Fin de l'enchère: <span th:text="${#dates.format(article.dateFinEnch, 'dd/MM/yyyy')}"></span></h6> <h6 class="text-muted"> <span th:text="${#dates.format(article.dateFinEnch, 'dd/MM/yyyy')}"></span></h6>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,79 +1,71 @@
<!DOCTYPE html> <!DOCTYPE html>
<html th:replace="~{modele-page :: layout('Panel administrateur',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org"> <html th:replace="~{modele-page :: layout('__${#messages.msg('admin.panel.title')}__',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css"> <!-- Ajoutez le lien vers votre fichier CSS si nécessaire --> <link rel="stylesheet" type="text/css" href="style.css"> <!-- Ajoutez le lien vers votre fichier CSS si nécessaire -->
</head> </head>
<body> <body>
<div id="container-main"> <div id="container-main">
<h2>Liste des catégories modifiées</h2> <h2 th:text="#{admin.categories.title}">Liste des catégories modifiées</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Nom</th> <th th:text="#{admin.categories.table.name}">Nom</th>
<th>Action</th> <th th:text="#{admin.categories.table.action}">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="categorie : ${categories}"> <tr th:each="categorie : ${categories}">
<td> <td>
<form th:action="@{/admin/update}" method="post"> <form th:action="@{/admin/update}" method="post">
<input type="text" name="newCategorie" id="newCategorie" th:value="${categorie.libelle}"> <input type="text" name="newCategorie" id="newCategorie" th:value="${categorie.libelle}">
<input type="hidden" name="IdCategorie" id="IdCategorie" th:value="${categorie.id}"> <input type="hidden" name="IdCategorie" id="IdCategorie" th:value="${categorie.id}">
<button>Sauvegarder</button> <button th:text="#{admin.categories.table.save}">Sauvegarder</button>
</form> </form>
</td> </td>
<td> <td>
<form th:action="@{/admin/deleteC}" method="post"> <form th:action="@{/admin/catDelete}" method="post">
<input type="hidden" name="deleteIdCategorie" id="deleteIdCategorie" th:value="${categorie.id}"> <input type="hidden" name="deleteIdCategorie" id="deleteIdCategorie" th:value="${categorie.id}">
<button>Supprimer</button> <button th:text="#{admin.categories.table.delete}">Supprimer</button>
</form> </form>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<form th:action="@{/admin/new}" th:object="${categorie}" method="post"> <form th:action="@{/admin/new}" th:object="${categorie}" method="post">
<input type="text" th:field="*{libelle}" id="nom"> <input type="text" th:field="*{libelle}" id="nom">
<button>Ajouter</button> <button th:text="#{admin.categories.table.add}">Ajouter</button>
</form> </form>
<h2>Liste des utilisateurs</h2> <h2 th:text="#{admin.users.title}">Liste des utilisateurs</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>ID</th> <th th:text="#{admin.users.table.id}">ID</th>
<th>Pseudo</th> <th th:text="#{admin.users.table.username}">Pseudo</th>
<th>Nom</th> <th th:text="#{admin.users.table.lastname}">Nom</th>
<th>Prénom</th> <th th:text="#{admin.users.table.firstname}">Prénom</th>
<th>Email</th> <th th:text="#{admin.users.table.email}">Email</th>
<th>Crédit(s)</th> <th th:text="#{admin.users.table.action}">Action</th>
<th>Action</th> </tr>
</tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="user : ${userProfil}"> <tr th:each="user : ${userProfil}">
<td th:text="${user.id}"></td> <td th:text="${user.id}"></td>
<td th:text="${user.pseudo}"></td> <td th:text="${user.pseudo}"></td>
<td th:text="${user.nom}"></td> <td th:text="${user.nom}"></td>
<td th:text="${user.prenom}"></td> <td th:text="${user.prenom}"></td>
<td th:text="${user.email}"></td> <td th:text="${user.email}"></td>
<td> <td>
<form th:action="@{/admin/update/credit}" method="post"> <form th:action="@{/admin/disabled}" method="post">
<input type="number" name="newCredit" id="newCredit" th:value="${user.credit}"> <input type="hidden" name="userDisabled" id="userDisabled" th:value="${user.id}">
<input type="hidden" name="idUser" id="idUser" th:value="${user.id}"> <button th:text="#{admin.users.table.disable}">Désactiver</button>
<button>Sauvegarder</button> </form>
</form> <form th:action="@{/admin/delete}" method="post">
</td> <input type="hidden" name="userDelete" id="userDelete" th:value="${user.id}">
<td> <button th:text="#{admin.users.table.delete}">Supprimer</button>
<form th:action="@{/admin/disabled}" method="post"> </form>
<input type="hidden" name="userDisabled" id="userDisabled" th:value="${user.id}"> </td>
<button >Désactiver</button> </tr>
</form>
<form th:action="@{/admin/delete}" method="post">
<input type="hidden" name="userDelete" id="userDelete" th:value="${user.id}">
<button>Supprimer</button>
</form>
</td>
</tr>
</tbody> </tbody>
</table> </table>

View File

@@ -1,76 +1,68 @@
<!DOCTYPE html> <!DOCTYPE html>
<html th:replace="~{modele-page :: layout('Article - NOMARTICLE',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org"> <html th:replace="~{modele-page :: layout('${articleDetailsTitle}',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
</head> </head>
<body> <body>
<div id="container-main"> <div id="container-main">
<div class="row mt-3"> <div class="row mt-3">
<div class="col-md-6 offset-md-3"> <div class="col-md-6 offset-md-3">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h4>Article</h4> <h4 th:text="#{article.details.heading}"></h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<img th:src="@{'/images/articles/' + ${article.id} + '.jpg'}" alt="image-vente" class="img-thumbnail" style="width: 250px; height: auto;">
</div> </div>
<div class="card-body"> <div class="col-md-9 d-flex flex-column">
<div class="row"> <div class="mt-2 d-flex flex-column align-items-center">
<div class="col-md-3"> <h1 th:text="${article.nom}"></h1>
<img th:src="@{'/images/articles/' + ${article.id} + '.jpg'}" alt="image-vente" class="img-thumbnail" style="width: 250px; height: auto;"> </div>
</div> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<div class="col-md-9 d-flex flex-column"> <strong><label class="col-form-label" th:text="#{article.details.label.description}"></label></strong>
<div class="mt-2 d-flex flex-column align-items-center"> <span th:text="${article.desc}"></span>
<h1 th:text="${article.nom}"></h1> </div>
</div> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> <strong><label class="col-form-label" th:text="#{article.details.label.seller}"></label></strong>
<strong><label class="col-form-label">Description</label></strong> <span th:text="${username.pseudo}"></span>
<span th:text="${article.desc}"></span> </div>
</div> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> <strong><label class="col-form-label" th:text="#{article.details.label.category}"></label></strong>
<strong><label class="col-form-label">Vendeur</label></strong> <span th:text="${cate}"></span>
<span th:text="${username.pseudo}"></span> </div>
</div> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> <strong><label class="col-form-label" th:text="#{article.details.label.sale_price}"></label></strong>
<strong><label class="col-form-label">Catégorie</label></strong> <span th:text="${article.prixInitial}"></span>
<span th:text="${cate}"></span> </div>
</div> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> <strong><label class="col-form-label" th:text="#{article.details.label.end_date}"></label></strong>
<strong><label class="col-form-label">Prix de vente</label></strong> <span th:text="${article.dateFinEnch}"></span>
<span th:text="${article.prixInitial}"></span> </div>
</div> <!-- Rajouter une condition sur retrait pour l'afficher uniquement quand -->
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> <!-- la vente est gagné ET à l'utilisateur qui a remporté la vente-->
<strong><label class="col-form-label">Dernière offre</label></strong> <div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<span th:text="${maxEnchere} ? ${maxEnchere} : 'Aucune offre en cours'"></span> <strong><label class="col-form-label" th:text="#{article.details.label.pickup}"></label></strong>
</div> <span th:text="${retrait} ? ${retrait.rue} + ' ' + ${retrait.code_postale} + ' ' + ${retrait.ville} : #{article.details.address.unknown}"></span>
<div class="mt-2 d-flex flex-row align-items-end justify-content-between"> </div>
<strong><label class="col-form-label">Date fin enchère</label></strong> <form th:action="@{/enchere/incEnchere}" method="post" th:object="${enchere}" class="mt-2 d-flex flex-row align-items-end justify-content-between">
<span th:text="${article.dateFinEnch}"></span> <input type="hidden" id="articleId" name="articleId" th:value="${article.id}">
</div> <label for="montantEnchere" th:text="#{article.details.label.amount}"></label>
<!-- Rajouter une condition sur retrait pour l'afficher uniquement quand --> <input type="number" th:field="*{montantEnchere}" id="montantEnchere" step="0.01" min="0">
<!-- la vente est gagné ET à l'utilisateur qui a remporté la vente--> <span style="color: red;" th:if="${#fields.hasErrors('montantEnchere')}">
<div class="mt-2 d-flex flex-row align-items-end justify-content-between">
<strong><label class="col-form-label">Retrait</label></strong>
<span th:text="${retrait} ? ${retrait.rue} + ' ' + ${retrait.code_postale} + ' ' + ${retrait.ville} : 'Adresse inconnue'"></span>
</div>
<form th:action="@{/enchere/incEnchere}" method="post" th:object="${enchere}" class="mt-2 d-flex flex-row align-items-end justify-content-between">
<input type="hidden" id="articleId" name="articleId" th:value="${article.id}">
<strong><label for="montantEnchere">Montant</label></strong>
<input type="number" th:field="*{montantEnchere}" id="montantEnchere" step="0.01" min="0">
<span style="color: red;" th:if="${errors != null}">
<ul> <ul>
<li th:each="erreur: ${errors[0]}" th:text="${erreur.defaultMessage}"></li> <li th:each="erreur: ${#fields.errors('montantEnchere')}" th:text="${erreur}"></li>
</ul> </ul>
</span> </span>
<button type="submit" class="btn btn-primary">Enchérir</button> <button type="submit" class="btn btn-primary" th:text="#{article.details.button.bid}"></button>
</form> </form>
<div class="mt-5">
<a class="btn btn-secondary" href="/accueil" th:text="'Retour'"></a>
<a th:if="${#strings.equals(user.getPseudo(), article.pseudoUtilisateur)}" class="btn btn-secondary" th:href="@{/article/edit(id=${article.id})}" th:text="'Modifier'"></a>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</body> </div>
</div>
</body>
</html> </html>

View File

@@ -69,8 +69,7 @@
<h6 class="text-uppercase fw-bold mb-4"> <h6 class="text-uppercase fw-bold mb-4">
<i class="fas fa-gem me-3"></i>ENI-Encheres <i class="fas fa-gem me-3"></i>ENI-Encheres
</h6> </h6>
<p> <p th:text="#{footer.desc}">
Créée par l'association "Les objets sont nos amis", ENI-Enchères a pour objectif d'aider ses membres à vendre ou acheter des objets de tout genre.
</p> </p>
</div> </div>
@@ -79,13 +78,13 @@
Menu Menu
</h6> </h6>
<p> <p>
<a href="#!" class="text-reset">Encheres</a> <a href="/accueil" class="text-reset" th:text="#{home.nav.enchere}"></a>
</p> </p>
<p> <p>
<a href="#!" class="text-reset">Vendre un article</a> <a href="/article/new" class="text-reset" th:text="#{home.nav.vend}"></a>
</p> </p>
<p> <p>
<a href="#!" class="text-reset">Mon profile</a> <a href="/profil" class="text-reset" th:text="#{profil.title}"></a>
</p> </p>
</div> </div>

View File

@@ -6,76 +6,76 @@
</head> </head>
<body> <body>
<div id="container-main" class="container py-5"> <div id="container-main" class="container py-5">
<h1 class="mb-4">Nouvelle vente</h1> <h1 class="mb-4" th:text="#{article.add.heading}">Nouvelle vente</h1>
<form th:action="@{/article/new}" method="post" th:object="${article}" enctype="multipart/form-data" class="needs-validation" novalidate> <form th:action="@{/article/new}" method="post" th:object="${article}" enctype="multipart/form-data" class="needs-validation" novalidate>
<div class="mb-3"> <div class="mb-3">
<label for="nom" class="form-label">Article:</label> <label for="nom" class="form-label" th:text="#{article.add.form.label.name}">Article:</label>
<input type="text" class="form-control" th:field="*{nom}" id="nom" required> <input type="text" class="form-control" th:field="*{nom}" id="nom" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="description" class="form-label">Description:</label> <label for="description" class="form-label" th:text="#{article.add.form.label.description}">Description:</label>
<textarea class="form-control" th:field="*{desc}" id="description" required></textarea> <textarea class="form-control" th:field="*{desc}" id="description" required></textarea>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="categorie" class="form-label">Catégorie:</label> <label for="categorie" class="form-label" th:text="#{article.add.form.label.category}">Catégorie:</label>
<select class="form-control" th:field="*{numCategorie}" id="categorie" required> <select class="form-control" th:field="*{numCategorie}" id="categorie" required>
<option th:each="categorie : ${categories}" th:value="${categorie.id}" th:text="${categorie.libelle}"></option> <option th:each="categorie : ${categories}" th:value="${categorie.id}" th:text="${categorie.libelle}"></option>
</select> </select>
<div class="invalid-feedback">Veuillez sélectionner une catégorie.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.category}">Veuillez sélectionner une catégorie.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="photo" class="form-label">Photo de l'article:</label> <label for="photo" class="form-label" th:text="#{article.add.form.label.photo}">Photo de l'article:</label>
<input type="file" class="form-control" th:field="*{photo}" id="photo" accept="image/jpeg"> <input type="file" class="form-control" th:field="*{photo}" id="photo" accept="image/jpeg">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="prix" class="form-label">Mise à prix:</label> <label for="prix" class="form-label" th:text="#{article.add.form.label.starting_price}">Mise à prix:</label>
<input type="number" class="form-control" th:field="*{prixInitial}" id="prix" min="0" max="2000000000" step="0.01" required> <input type="number" class="form-control" th:field="*{prixInitial}" id="prix" min="0" max="2000000000" step="0.01" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="dateDebut" class="form-label">Date début enchère:</label> <label for="dateDebut" class="form-label" th:text="#{article.add.form.label.start_date}">Date début enchère:</label>
<input type="date" class="form-control" id="dateDebut" name="dateDebut" required> <input type="date" class="form-control" id="dateDebut" name="dateDebut" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="dateFin" class="form-label">Date fin enchère:</label> <label for="dateFin" class="form-label" th:text="#{article.add.form.label.end_date}">Date fin enchère:</label>
<input type="date" class="form-control" id="dateFin" name="dateFin" required> <input type="date" class="form-control" id="dateFin" name="dateFin" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<h4>Retrait</h4> <h4 th:text="#{article.add.form.label.removal}">Retrait</h4>
<div class="mb-3"> <div class="mb-3">
<label for="rue" class="form-label">Rue:</label> <label for="rue" class="form-label" th:text="#{article.add.form.label.street}">Rue:</label>
<input type="text" class="form-control" id="rue" name="rue" th:field="${user.rue}" required> <input type="text" class="form-control" id="rue" name="rue" th:field="${user.rue}" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="codePostal" class="form-label">Code postal:</label> <label for="codePostal" class="form-label" th:text="#{article.add.form.label.postal_code}">Code postal:</label>
<input type="text" class="form-control" id="codePostal" name="code_postal" th:field="${user.code_postal}" required> <input type="text" class="form-control" id="codePostal" name="code_postal" th:field="${user.code_postal}" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="ville" class="form-label">Ville:</label> <label for="ville" class="form-label" th:text="#{article.add.form.label.city}">Ville:</label>
<input type="text" class="form-control" id="ville" name="ville" th:field="${user.ville}" required> <input type="text" class="form-control" id="ville" name="ville" th:field="${user.ville}" required>
<div class="invalid-feedback">Ce champ est requis.</div> <div class="invalid-feedback" th:text="#{article.add.form.validation.required}">Ce champ est requis.</div>
</div> </div>
<button type="submit" class="btn btn-primary">Enregistrer</button> <button type="submit" class="btn btn-primary" th:text="#{article.add.form.button.save}">Enregistrer</button>
<div th:if="${param.erreur != null}" class="mt-3"> <div th:if="${param.erreur != null}" class="mt-3">
<p style="color: red;" th:text="${param.erreur}"></p> <p style="color: red;" th:text="${param.erreur}"></p>
</div> </div>
</form> </form>
<form th:action="@{/accueil}" method="post" class="mt-3"> <form th:action="@{/accueil}" method="post" class="mt-3">
<button type="submit" class="btn btn-secondary">Annuler</button> <button type="submit" class="btn btn-secondary" th:text="#{article.add.form.button.cancel}">Annuler</button>
</form> </form>
<script> <script>
var today = new Date(); var today = new Date();