gui: Home skelleton

pull/1/head
Lunix-420 2024-10-30 19:03:58 +01:00
parent eb35d10c63
commit d429840f5a
6 changed files with 6 additions and 38 deletions

View File

@ -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";
}
}

View File

@ -1,4 +0,0 @@
<div th:fragment="aboutContent">
<h2>About Us</h2>
<p>This is the about page content.</p>
</div>

View File

@ -1,4 +0,0 @@
<div th:fragment="contactContent">
<h2>Contact Us</h2>
<p>This is the contact page content.</p>
</div>

View File

@ -0,0 +1,3 @@
<footer>
<p>© 2024 My Website</p>
</footer>

View File

@ -1,4 +0,0 @@
<div th:fragment="homeContent">
<h2>Welcome to the Home Page</h2>
<p>This is the home page content.</p>
</div>

View File

@ -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>