profile
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
package fr.eni.enchere.controllers;
|
||||||
|
|
||||||
|
import fr.eni.enchere.bo.UserProfil;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import fr.eni.enchere.bll.UserService;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller()
|
||||||
|
@RequestMapping("/profile")
|
||||||
|
public class ProfileController {
|
||||||
|
|
||||||
|
private final UserService userService;
|
||||||
|
|
||||||
|
public ProfileController(UserService userService) {
|
||||||
|
this.userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String viewProfile(Model model) {
|
||||||
|
model.addAttribute("user", new UserProfil());
|
||||||
|
return "profile";
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/main/resources/templates/profile.html
Normal file
27
src/main/resources/templates/profile.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr" th:replace="~{modele-page :: layout('Profile',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Mon profile</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container-main">
|
||||||
|
<form th:action="@{/profile/updateUser}" method="post">
|
||||||
|
<h2>Mon profile</h2>
|
||||||
|
<div class="d-flex flew-column">
|
||||||
|
<div><label>Pseudo : <input type="text" name="username"/></label></div>
|
||||||
|
<div><label>Prénom : <input type="text" name="name"/></label></div>
|
||||||
|
<div><label>Téléphone : <input type="text" name="phone"/></label></div>
|
||||||
|
<div><label>Code postal : <input type="text" name="postalCode"/></label></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex flew-column">
|
||||||
|
<div><label>Nom : <input type="text" name="lastName"/></label></div>
|
||||||
|
<div><label>Email : <input type="text" name="email"/></label></div>
|
||||||
|
<div><label>Rue : <input type="text" name="address"/></label></div>
|
||||||
|
<div><label>Ville : <input type="text" name="city"/></label></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user