mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-06-23 22:03: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.
58 lines
3.6 KiB
HTML
58 lines
3.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='Lagerverwaltung')}">
|
||
<body>
|
||
<div layout:fragment="content">
|
||
<h2 th:text="${'Produkt ' + (actionIsAdd ? 'anlegen' : 'bearbeiten')}"></h2>
|
||
<form method="post" th:object="${form}">
|
||
<div class="mb-3" th:if="${actionIsAdd}">
|
||
<a th:href="@{/inventory/add?type=Consumable}" class="btn" th:classappend="${form.getClass().getSimpleName() == 'ConsumableMutateForm' ? 'btn-primary' : 'btn-secondary'}">Verbrauchsmaterial</a>
|
||
<a th:href="@{/inventory/add?type=Rentable}" class="btn" th:classappend="${form.getClass().getSimpleName() == 'RentableMutateForm' ? 'btn-primary' : 'btn-secondary'}">Leihmaterial</a>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label class="form-label" for="name">Produktname</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="quantity">Menge im Bestand</label>
|
||
<input class="form-control" type="number" th:field="*{quantity}" th:errorclass="is-invalid" required/>
|
||
<div th:if="${#fields.hasErrors('quantity')}" class="invalid-feedback">Ungültige Menge.</div>
|
||
</div>
|
||
<!-- the prices aren’t bound with th:field as they need special formatting -->
|
||
<div class="mb-3">
|
||
<label class="form-label" for="wholesalePrice">Einkaufspreis</label>
|
||
<input class="form-control" type="number" name="wholesalePrice" th:value="${#numbers.formatDecimal(form.wholesalePrice, 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0" required/>
|
||
<div th:if="${#fields.hasErrors('wholesalePrice')}" class="invalid-feedback">Ungültiger Einkaufspreis.</div>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label class="form-label" for="retailPrice">UVP</label>
|
||
<input class="form-control" type="number" name="retailPrice" th:value="${#numbers.formatDecimal(form.retailPrice, 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0" required/>
|
||
<div th:if="${#fields.hasErrors('retailPrice')}" class="invalid-feedback">Ungültiger Verkaufspreis.</div>
|
||
</div>
|
||
<div class="mb-3" th:if="${form.getClass().getSimpleName() == 'ConsumableMutateForm'}">
|
||
<label class="form-label" for="promotionPrice">Aktionspreis</label>
|
||
<input class="form-control" type="number" name="promotionPrice" th:value="${#numbers.formatDecimal(form.promotionPrice.orElse(null), 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0"/>
|
||
<div th:if="${#fields.hasErrors('promotionPrice')}" class="invalid-feedback">Ungültiger Aktionspreis.</div>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label class="form-label" for="orderTypes">Buchungstypen</label>
|
||
<select class="form-select" multiple th:field="*{orderTypes}" th:errorclass="is-invalid">
|
||
<option th:each="orderType : ${T(catering.order.OrderType).values()}" th:value="${orderType}" th:text="${orderType.toHumanReadable()}"/>
|
||
</select>
|
||
<div th:if="${#fields.hasErrors('orderTypes')}" class="invalid-feedback">Ungültiger Buchungstyp.</div>
|
||
<div class="form-text">Mehrfachauswahl ist mit Umschalt- bzw. Steuerungstaste möglich.</div>
|
||
</div>
|
||
<button class="btn btn-primary" type="submit" th:text="${actionIsAdd ? 'Hinzufügen' : 'Bearbeiten'}"></button>
|
||
<!-- KANN: Bild und Beschreibungstext -->
|
||
</form>
|
||
</div>
|
||
</body>
|
||
</html>
|