mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-06-30 18:03:42 +02:00
44 lines
2.4 KiB
HTML
44 lines
2.4 KiB
HTML
<!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 ' + (product == null ? 'anlegen' : 'bearbeiten')}"></h2>
|
|
<!-- TODO: maybe migrate to th:field (which is a pain) -->
|
|
<form method="post">
|
|
<div class="mb-3">
|
|
<label class="form-label" for="type">Typ</label>
|
|
<div class="form-check form-check-inline" th:each="type : ${T(catering.catalog.CatalogDummyType).values()}">
|
|
<input class="form-check-input" type="radio" name="type" th:value="${type}" th:text="${type}" th:checked="${type.name() == product?.type?.name()}" required/>
|
|
</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label" for="name">Produktname</label>
|
|
<input class="form-control" type="text" name="name" th:value="${product?.name}" required/>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label" for="quantity">Menge im Bestand</label>
|
|
<input class="form-control" type="number" name="quantity" th:value="${item?.quantity}" required/>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label" for="wholesalePrice">Einkaufspreis</label>
|
|
<input class="form-control" type="number" name="wholesalePrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.wholesalePrice?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label" for="retailPrice">UVP</label>
|
|
<input class="form-control" type="number" name="retailPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.price?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
|
|
</div>
|
|
<div class="mb-3">
|
|
<!-- FIXME darf nur bei angeboten als teil von partyservice angezeigt werden -->
|
|
<label class="form-label" for="promotionPrice">Aktionspreis</label>
|
|
<input class="form-control" type="number" name="promotionPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.promotionPrice?.getNumber()?.doubleValueExact(), 1, 2)}"/>
|
|
</div>
|
|
<button class="btn btn-primary" type="submit" th:text="${product == null ? 'Hinzufügen' : 'Bearbeiten'}"></button>
|
|
<!-- KANN: Bild und Beschreibungstext -->
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|