patch session utilisateur

This commit is contained in:
jleroy
2024-04-24 08:47:09 +02:00
parent fa8b266f4c
commit ce9b0a212c
5 changed files with 43 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="fr" th:replace="~{modele-page :: layout('Profile',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<html lang="fr" th:replace="~{modele-page :: layout('Modifier votre profile',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
</head>
@@ -107,6 +107,17 @@
</span>
</div>
<!-- Champ Mot de passe-->
<div class="champ-saisie">
<label for="password">Mot de passe actuel: </label>
<div>
<input type="password" th:field="*{password}" id="password" />
</div>
<span style="color: red;" th:if="${#fields.hasErrors('password')}">
<ul>
<li th:each="erreur: ${#fields.errors('password')}" th:text="${erreur}"></li>
</ul>
</span>
</div>
<div class="champ-saisie">
<label for="password">Nouveau mot de passe: </label>
<div>
@@ -125,10 +136,11 @@
</div>
</div>
<div>Crédits: <span th:text="${userProfile.credit}"></span></div>
<!-- Input cacher qui permet de stocker l'id du compte utilisateur à mettre à jour -->
<input type="hidden" id="userId" name="userId" th:field="*{id}" th:value="${userProfile.id}" />
<input type="submit" value="Enregistrer"/>
</form>
<form th:action="@{/profile/delete}" method="post">
<form th:action="@{/profil/delete}" method="post">
<button type="submit">Supprimer mon compte</button>
</form>
</div>

View File

@@ -125,7 +125,7 @@
</div>
<input type="submit" value="Créer" />
</form>
<form action="/" method="post">
<form th:action="@{/accueil}" method="post">
<button type="submit">Annuler</button>
</form>
</div>

View File

@@ -25,7 +25,7 @@
<a class="nav-link" href="#">Vendre un article</a>
</li>
<li class="nav-item" th:if="${#authorization.expression('hasRole(''MEMBRE'')')}">
<a class="nav-link" href="/profile">Mon profile</a>
<a class="nav-link" href="/profil">Mon profile</a>
</li>
<li class="nav-item" th:if="${#authorization.expression('hasRole(''MEMBRE'')')}">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true" >Déconnection</a>