swt23w23/src/main/resources/templates/catalog_editor.html

85 lines
3.3 KiB
HTML
Raw Normal View History

<!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="events"></label>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/chooseEvent}">
<select name="events" id="events">
<option value="event_catering">Eventcatering</option>
<option value="party_service">Partyservice</option>
<option value="mobile_breakfast">Mobile Breakfast</option>
<option value="rent_a_cook">Rent-a-Cook</option>
</select>
<button type="submit">Event auswählen</button>
</form>
Eventbasispreis: 500€
<h2>Mindestzeitraum</h2>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/add_time}">
<label>Mindestzeitraum:</label>
<input type="hidden" th:field="*{eventType}">
<input th:field="*{minimumTimePeriod}" type="number" min="0" step="1" value="1"/>
<button type="submit">Zum Model hinzufügen</button>
</form>
<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" name="id" th:value="${item.getItemId()}">
<button type="submit">Entfernen</button>
</form>
</td>
</table>
<hr>
<div style="height: 20px;"></div>
<form method="post" th:action="@{/catalog_editor/product_add}">
<label for="name">Produktname</label>
<input type="text" id="name" name="name" required>
<label for="amount">Menge</label>
<input type="number" id="amount" name="amount" min="1" required>
<input type="hidden" name="cost" value="50.0">
<button type="submit">Artikel hinzufügen</button>
</form>hinzufügen
<br>
<h3>Momentane Auswahl</h3>
Eventtyp: <span th:text="${formCatalogEntry.getEventType()}"></span><br>
Mindestzeitraum: <span th:text="${formCatalogEntry.getMinimumTimePeriod()}"></span><br>
<span>Gesamtpreis: 90 €</span>
<form method="post" th:action="@{/catalog_editor/catalog_add}" th:object="${formCatalogEntry}">
<input type="hidden" name="eventType" th:value="${formCatalogEntry.getEventType()}">
<input type="hidden" name="products" th:value="${inventory}">
<input type="hidden" name="minimumTimePeriod" th:value="${formCatalogEntry.getMinimumTimePeriod}">
<input type="hidden" name="totalCost" th:value="${formCatalogEntry.getTotalCost()}">
<button type="submit">Zum Katalog hinzufügen</button>
</form>
</div>
</body>
</html>