gui: Home skelleton
parent
eb35d10c63
commit
d429840f5a
|
@ -9,25 +9,6 @@ public class PageController {
|
|||
|
||||
@GetMapping("/")
|
||||
public String home(Model model) {
|
||||
model.addAttribute("activePage", "home");
|
||||
model.addAttribute("pageTitle", "Home");
|
||||
model.addAttribute("contentFragment", "~{_home :: homeContent}");
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping("/about")
|
||||
public String about(Model model) {
|
||||
model.addAttribute("activePage", "about");
|
||||
model.addAttribute("pageTitle", "About Us");
|
||||
model.addAttribute("contentFragment", "~{_about :: aboutContent}");
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping("/contact")
|
||||
public String contact(Model model) {
|
||||
model.addAttribute("activePage", "contact");
|
||||
model.addAttribute("pageTitle", "Contact Us");
|
||||
model.addAttribute("contentFragment", "~{_contact :: contactContent}");
|
||||
return "index";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
<div th:fragment="aboutContent">
|
||||
<h2>About Us</h2>
|
||||
<p>This is the about page content.</p>
|
||||
</div>
|
|
@ -1,4 +0,0 @@
|
|||
<div th:fragment="contactContent">
|
||||
<h2>Contact Us</h2>
|
||||
<p>This is the contact page content.</p>
|
||||
</div>
|
|
@ -0,0 +1,3 @@
|
|||
<footer>
|
||||
<p>© 2024 My Website</p>
|
||||
</footer>
|
|
@ -1,4 +0,0 @@
|
|||
<div th:fragment="homeContent">
|
||||
<h2>Welcome to the Home Page</h2>
|
||||
<p>This is the home page content.</p>
|
||||
</div>
|
|
@ -1,15 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title th:text="${pageTitle}">My Website</title>
|
||||
<title>My Website</title>
|
||||
</head>
|
||||
<body>
|
||||
<div th:replace="~{_header :: header(activePage=${activePage})}"></div>
|
||||
<div th:replace="~{_header :: header(activePage=${home})}"></div>
|
||||
|
||||
<div th:replace="${contentFragment}"></div>
|
||||
|
||||
<footer>
|
||||
<p>© 2024 My Website</p>
|
||||
</footer>
|
||||
<div th:replace="~{_footer :: footer}"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue