swt23w23/src/main/resources/templates/staff.html
Simon Bruder bac025fd0a
Make project REUSE compliant
This finally makes the licensing under AGPL-3.0-or-later explicit after
I got the okay from the kickstart source owners.

This also checks the REUSE compliance in a pre commit hook, and
therefore also in CI.
2023-12-11 17:59:14 +01:00

79 lines
2.8 KiB
HTML

<!--/*-->
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-FileCopyrightText: 2023 swt23w23
<!--*/-->
<!DOCTYPE html>
<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')}"
>
<head> </head>
<body>
<div layout:fragment="content">
<div>
<h2>Mitarbeiterdetails</h2>
<form th:action="@{/staff}" method="get">
<div class="mb-3">
<label for="month">Monat:</label>
<input type="month" name="month" id="month" th:value="${month}" required>
</div>
<button class="btn btn-primary" type="submit">Zeitangabe aktualisieren</button>
</form>
<table class="table">
<tr>
<th>Name</th>
<th>Beruf</th>
<th>Lohn</th>
<th>Arbeitszeit</th>
<th></th>
<th></th>
</tr>
<tr th:each="employee : ${staff}">
<td th:text="${employee.name}">Max</td>
<td th:text="${employee.job}">Koch</td>
<td th:text="${employee.wage}"></td>
<td th:with="month=${month}" th:text="${management.getWorkingHoursByEmployee(employee, month)}"></td>
<td>
<a th:href="@{'/staff/edit/' + ${employee.id}}"
><button class="btn btn-warning">Bearbeiten</button></a
>
</td>
<td>
<form th:action="@{/staff/remove}" method="post">
<input type="hidden" th:name="id" th:value="${employee.id}" />
<button type="submit" class="btn btn-danger">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<div>
<h2>Personal Hinzufügen</h2>
<form th:object="${form}" th:action="@{/staff/add}" method="post">
<div class="mb-3">
<label class="form-label" for="name">Name</label>
<input class="form-control" type="text" th:field="*{name}" th:errorclass="is-invalid" required>
<div th:if="${#fields.hasErrors('name')}" class="invalid-feedback">Ungültiger Name</div>
</div>
<div class="mb-3">
<label class="form-label" for="wage">Lohn</label>
<input class="form-control" type="text" th:field="*{wage}" th:errorclass="is-invalid" required>
<div th:if="${#fields.hasErrors('wage')}" class="invalid-feedback">Ungültiger Lohn</div>
</div>
<div class="mb-3">
<label class="form-label" for="job">Beruf:</label>
<select th:field="*{job}" class="form-select" th:errorclass="is-invalid">
<option th:each="type : ${T(catering.staff.JobType).values()}" th:value="${type}" th:text="${type}" required></option>
</select>
<div th:if="${#fields.hasErrors('job')}" class="invalid-feedback">Ungültiger Job</div>
</div>
<button class="btn btn-primary" type="submit">Hinzufügen</button>
</form>
</div>
</div>
</body>
</html>