swt23w23/src/main/resources/templates/catalog_editor.html
2023-11-21 18:00:26 +01:00

74 lines
2.5 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">
<head>
<title>Basisevent-Konfiguration</title></head>
<body>
<nav>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
</div>
</nav>
<h1>Basisevent konfigurieren</h1>
<input type="hidden" name="addCatalog">
<div class="content">
<h2>Dienstleistung</h2>
<label for="dienstleistungen"></label>
<select name="dienstleistungen" id="dienstleistungen">
<option value="eventcatering">Eventcatering</option>
<option value="partyservice">Partyservice</option>
<option value="mobile_breakfast">Mobile Breakfast</option>
<option value="rent-a-cook">Rent-a-Cook</option>
</select>
Eventbasispreis: 500€
<h2>Mindestzeitraum</h2>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/add_time}">
<label>Mindestzeitraum:
<input th:field="*{minimumTimePeriod}" type="number" name="minimumTimePeriod" min="1" step="1" value="1"/>
<button type="submit">Zum Model hinzufügen</button>
</label>
</form>
<span th:text="${formCatalogEntry.minimumTimePeriod}"></span>
<h2>Basisausstattung</h2>
<table>
<tr>
<th>Produktname</th>
<th>Menge</th>
<th>Stückpreis</th>
</tr>
<tr th:each="item : ${inventory}">
<td th:text="${item.getName()}">
<td th:text="${item.getAmount()}">
<td th:text="${item.getCost()}">
<td>
<form method="post" th:action="@{/catalog_editor/remove_product}">
<input type="hidden" th:action="${inventory.remove(item.getItemId())}" name="productId" th:value="${item.getItemId()}">
<button type="submit">Entfernen</button>
</form>
</td>
<tr>
<td>
<form method="post" th:action="@{/catalog_editor/product_add}">
<input type="hidden" name="addProduct">
<button type="submit">Artikel hinzufügen</button>
</form>
</td>
</tr>
</table>
<br>
Gesamtpreis: 90 €<br>
<form method="post" th:action="@{/catalog_editor/catalog_add}" th:object="${formCatalogEntry}">
<button type="submit">Zum Katalog hinzufügen</button>
</form>
</div>
</body>
</html>