Merge pull request 'gui: Home skeleton' (#7) from 3002833/Backend:main into main

Reviewed-on: Maradona/Backend#7
pull/1/head
David Hess 2024-10-30 19:15:42 +01:00
commit 67b9333c29
5 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package com.maradona.backend.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class PageController {
@GetMapping("/")
public String home(Model model) {
return "index";
}
}

View File

@ -21,3 +21,13 @@ spring:
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
thymeleaf:
prefix: "classpath:/templates/" # Path where Thymeleaf templates are stored
suffix: ".html" # File extension for Thymeleaf templates
cache: false # Disable caching for development (set to true in production)
mode: "HTML5" # Template mode; Thymeleaf parses the templates as HTML5
encoding: "UTF-8" # Character encoding for the templates
servlet:
content-type: "text/html" # Content type for the Thymeleaf-rendered HTML responses

View File

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

View File

@ -0,0 +1,28 @@
<header th:fragment="header(activePage)">
<h1>My Skill Management System</h1>
<nav>
<ul>
<li>
<a
th:href="@{/}"
th:classappend="${activePage == 'home' ? 'active' : ''}"
>Home</a
>
</li>
<li>
<a
th:href="@{/about}"
th:classappend="${activePage == 'about' ? 'active' : ''}"
>About</a
>
</li>
<li>
<a
th:href="@{/contact}"
th:classappend="${activePage == 'contact' ? 'active' : ''}"
>Contact</a
>
</li>
</ul>
</nav>
</header>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>My Website</title>
</head>
<body>
<div th:replace="~{_header :: header(activePage=${home})}"></div>
<div th:replace="~{_footer :: footer}"></div>
</body>
</html>