gui: Display projects
parent
96247b873e
commit
516950fd8b
|
@ -1,14 +1,24 @@
|
|||
package com.maradona.backend.controllers;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import com.maradona.backend.entities.Project;
|
||||
import com.maradona.backend.services.ProjectService;
|
||||
|
||||
@Controller
|
||||
public class PageController {
|
||||
|
||||
@Autowired
|
||||
private ProjectService projectService;
|
||||
|
||||
@GetMapping("/")
|
||||
public String home(Model model) {
|
||||
public String index(Model model) {
|
||||
var projects = projectService.getAllProjects();
|
||||
model.addAttribute("projects", projects);
|
||||
return "index";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<footer>
|
||||
<p>© INTER Versicherungsgruppe</p>
|
||||
<a href="Impressumlele">Impressum</a>
|
||||
<a href="Datenschutzlele">Datenschutz</a>
|
||||
<a href="Impressumlelele">Impressum</a>
|
||||
<a href="Datenschutzlelele">Datenschutz</a>
|
||||
</footer>
|
||||
|
|
|
@ -5,24 +5,24 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a
|
||||
th:href="@{/}"
|
||||
th:classappend="${activePage == 'benutzer' ? 'active' : ''}"
|
||||
th:href="@{/}"
|
||||
th:classappend="${activePage == 'benutzer' ? 'active' : ''}"
|
||||
>
|
||||
Benutzer
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
th:href="@{/notizen}"
|
||||
th:classappend="${activePage == 'notizen' ? 'active' : ''}"
|
||||
th:href="@{/notizen}"
|
||||
th:classappend="${activePage == 'notizen' ? 'active' : ''}"
|
||||
>
|
||||
Notizen
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
th:href="@{/service}"
|
||||
th:classappend="${activePage == 'service' ? 'active' : ''}"
|
||||
th:href="@{/service}"
|
||||
th:classappend="${activePage == 'service' ? 'active' : ''}"
|
||||
>
|
||||
Service
|
||||
</a>
|
||||
|
|
|
@ -6,7 +6,16 @@
|
|||
</head>
|
||||
<body>
|
||||
<div th:replace="~{_header :: header(activePage=${home})}"></div>
|
||||
|
||||
<div>
|
||||
<h2>Projects</h2>
|
||||
<ul>
|
||||
<li th:each="project : ${projects}">
|
||||
<span th:text="${project.name}">Project Name</span> -
|
||||
<span th:text="${project.startDate}">Start Date</span> to
|
||||
<span th:text="${project.endDate}">End Date</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div th:replace="~{_footer :: footer}"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue