swt23w23/src/main/resources/templates/staff.html

60 lines
1.8 KiB
HTML
Raw Normal View History

2023-11-10 17:09:39 +01:00
<!DOCTYPE html>
2023-11-13 20:09:39 +01:00
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Angestellte')}">
2023-11-10 17:09:39 +01:00
<head>
</head>
<body>
2023-11-15 17:27:04 +01:00
<div layout:fragment="content">
<div>
2023-11-13 20:09:39 +01:00
<h2>Mitarbeiterdetails</h2>
2023-11-15 17:27:04 +01:00
<table class="table">
2023-11-13 20:09:39 +01:00
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Vorname</th>
<th>Beruf</th>
2023-11-15 17:27:04 +01:00
<th></th>
<th></th>
2023-11-13 20:09:39 +01:00
</tr>
2023-11-10 17:09:39 +01:00
2023-11-13 20:09:39 +01:00
<tr th:each="staff : ${staffs}">
<td th:text="${staff.id}">01</td>
<td th:text="${staff.surname}">Musterkoch</td>
<td th:text="${staff.name}">Max</td>
<td th:text="${staff.job}">Koch</td>
<td>
2023-11-15 17:27:04 +01:00
<a th:href="@{'/staff/edit/' + ${staff.id}}"><button class="btn btn-warning">Bearbeiten</button></a>
2023-11-13 20:09:39 +01:00
</td>
<td>
<form th:action="@{/staff/remove}" method="post">
<input type="hidden" th:name="staffID" th:value="${staff.id}" />
2023-11-15 17:27:04 +01:00
<button type="submit" class="btn btn-danger">Entfernen</button>
2023-11-13 20:09:39 +01:00
</form>
</td>
</tr>
</table>
</div>
2023-11-15 17:27:04 +01:00
<div>
2023-11-13 20:09:39 +01:00
<h2>Personal Hinzufügen</h2>
<form action="/staff/add" method="post">
2023-11-15 17:27:04 +01:00
<div class="mb-3">
<label class="form-label" for="name">Name</label>
<input class="form-control" type="text" name="name" required />
</div>
<div class="mb-3">
<label class="form-label" for="surname">Nachname</label>
<input class="form-control" type="text" name="surname" required />
</div>
<div class="mb-3">
<label class="form-label" for="job">Beruf</label>
<input class="form-control" type="text" name="job" required />
</div>
<button class="btn btn-primary" type="submit">Hinzufügen</button>
2023-11-13 20:09:39 +01:00
</form>
</div>
2023-11-15 17:27:04 +01:00
</div>
2023-11-10 17:09:39 +01:00
</body>
</html>