mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-06-04 11:33:42 +02:00
Simon Bruder
bac025fd0a
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.
161 lines
6 KiB
HTML
161 lines
6 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='Event konfigurieren')}">
|
|
|
|
<body>
|
|
<div layout:fragment="content">
|
|
<form class="my-4" th:action="@{/event/changeOrderType}" method="post">
|
|
<select class="form-select w-auto d-inline-block" name="type">
|
|
<option th:selected="${event.getOrderType().toString() == enumValue.toString()}" th:each="enumValue : ${T(catering.order.OrderType).values()}" th:value="${enumValue.toString()}" th:text="${enumValue.toHumanReadable()}"/>
|
|
</select>
|
|
<button class="btn btn-primary" type="submit">Eventtypen ändern</button>
|
|
</form>
|
|
|
|
<form class="my-4" th:action="@{/event/changeDate}" method="post">
|
|
<label th:text="'Wählen sie ihren gewünschten Zeitraum aus (min. 7 Tage im voraus):'"/><br>
|
|
<input type="date" th:value="${event.getStart().toLocalDate()}" th:min="${minDate}" name="startDate"/>
|
|
<select class="i do not know" name="startHour">
|
|
<option disabled="disabled" selected value="NULL" th:text="${event.getStart().getHour()} + ' Uhr'"/>
|
|
<option th:each="i : ${#numbers.sequence(0, 23)}" th:value="${i}" th:text="${i} + ' Uhr'"></option>
|
|
</select>
|
|
<input type="date" th:value="${event.getFinish().toLocalDate()}" th:min="${minDate}" name="finishDate"/>
|
|
<select class="i do not know" name="finishHour">
|
|
<option disabled="disabled" selected value="NULL" th:text="${event.getFinish().getHour() + ' Uhr'}"/>
|
|
<option th:each="i : ${#numbers.sequence(0, 23)}" th:value="${i}" th:text="${i} + ' Uhr'"></option>
|
|
</select>
|
|
<button class="btn btn-primary" type="submit">Wunschdatum überprüfen</button>
|
|
</form>
|
|
|
|
<table class="table my-4">
|
|
<tr>
|
|
<th>Produkt</th>
|
|
<th>Anzahl</th>
|
|
<th>Preis</th>
|
|
<th></th>
|
|
</tr>
|
|
<tr th:each="item : ${cartConsumables}">
|
|
<td th:text="${item.getProductName()}"></td>
|
|
<td th:text="${item.getQuantity()}"></td>
|
|
<td th:text="${item.getPrice().getNumber().doubleValue()} +'€'"></td>
|
|
<td>
|
|
<form method="post" th:action="@{/event/removeProduct}">
|
|
<input type="hidden" th:value="${item.getId()}" name="itemId"/>
|
|
<button class="btn btn-danger" type="submit" >Produkt entfernen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<tr th:each="item : ${cartRentables}">
|
|
<td th:text="${item.getProductName()}"></td>
|
|
<td th:text="${item.getQuantity()}"></td>
|
|
<td th:text="${item.getProduct().getPriceForTime(duration).multiply(item.getQuantity().getAmount())} +'€'"></td>
|
|
<td>
|
|
<form method="post" th:action="@{/event/removeProduct}">
|
|
<input type="hidden" th:value="${item.getId()}" name="itemId"/>
|
|
<button class="btn btn-danger" type="submit">Produkt entfernen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<th>Angestellter</th>
|
|
<th>Typ</th>
|
|
<th>Preis</th>
|
|
<th></th>
|
|
<tr th:each="employee : ${event.getStaff()}">
|
|
<td th:text="${employee.getName()}"></td>
|
|
<td th:text="${employee.getJob()}"></td>
|
|
<td th:text="${event.getDurationInHours() * employee.getWage()} + '€'"></td>
|
|
<td>
|
|
<form method="post" th:action="@{/event/removeEmployee}">
|
|
<input type="hidden" th:value="${employee.getId()}" name="sid"/>
|
|
<button class="btn btn-danger" type="submit">Angestellten entfernen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<span th:text="'Gesamt: ' + ${totalPrice.getNumber() + '€'}"></span>
|
|
|
|
<form class="py-4" method="post" th:action="@{/event/checkout}">
|
|
<button class="btn btn-primary" type="submit">Kostenpflichtig bestellen</button>
|
|
</form>
|
|
|
|
<h4>Verbrauchsgegenstand hinzufügen</h4>
|
|
|
|
<table class="table my-4">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Preis/Stück</th>
|
|
<th>Verfügbar</th>
|
|
<th>Menge</th>
|
|
</tr>
|
|
<tr th:each="item : ${invConsumables.entrySet()}">
|
|
<td th:text="${item.getKey().getName()}"></td>
|
|
<td th:text="${item.getKey().getPrice()}"></td>
|
|
<td th:text="${item.getValue()}"></td>
|
|
<td>
|
|
<form th:action="@{/event/addProduct}" method="post">
|
|
<input id="number" type="number" name="number" min="1" th:max="${item.getValue()}" value="1"/>
|
|
<input type="hidden" name="pid" th:value="${item.getKey().getId()}"/>
|
|
<input class="btn btn-primary" type="submit" th:value="Hinzufügen"/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Mietgegenstand hinzufügen</h4>
|
|
|
|
<table class="table my-4">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Preis/Stück (Pauschale)</th>
|
|
<th>Preis/Stück/Stunde</th>
|
|
<th>Verfügbar</th>
|
|
<th>Menge</th>
|
|
</tr>
|
|
<tr th:each="item : ${invRentables.entrySet()}">
|
|
<td th:text="${item.getKey().getName()}"></td>
|
|
<td th:text="${item.getKey().getPrice()}"></td>
|
|
<td th:text="${item.getKey().getPrice()}"></td>
|
|
<td th:text="${item.getValue()}"></td>
|
|
<td>
|
|
<form th:action="@{/event/addProduct}" method="post">
|
|
<input id="number" type="number" name="number" min="1" th:max="${item.getValue()}" value="1"/>
|
|
<input type="hidden" name="pid" th:value="${item.getKey().getId()}"/>
|
|
<input class="btn btn-primary" type="submit" th:value="Hinzufügen"/>
|
|
</form>
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Angestellte hinzufügen</h4>
|
|
<table class="table my-4">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Typ</th>
|
|
<th>Stundensatz</th>
|
|
<th>Verfügbar</th>
|
|
<td></td>
|
|
</tr>
|
|
<tr th:each="employee : ${allStaff}">
|
|
<td th:text="${employee.getName()}"></td>
|
|
<td th:text="${employee.getJob()}"></td>
|
|
<td th:text="${employee.getWage()}"></td>
|
|
<td style="color: green" th:text="Verfügbar"></td>
|
|
<td>
|
|
<form th:action="@{/event/addEmployee}" method="post">
|
|
<input type="hidden" name="sid" th:value="${employee.getId()}"/>
|
|
<input class="btn btn-primary" type="submit" th:value="Hinzufügen"/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|