swt23w23/src/main/resources/templates/inventory.html
Simon Bruder ee7ab27a6d
Remove legacy from inventory template
The comments are already addressed (or not needed). Also, UUIDs really
are long and do not add any benefit to the administrator.
2023-12-05 12:17:22 +01:00

39 lines
1.7 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='Inventar')}">
<body>
<div layout:fragment="content">
<table class="table">
<thead>
<tr>
<th>Produktname</th>
<th>Menge</th>
<th>Einkaufspreis</th>
<th>UVP</th>
<th>Gesamtwert</th>
<th></th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${inventory}">
<td th:text="${item.product.name}"></td>
<td th:text="${item.quantity}"></td>
<td th:text="${item.product.wholesalePrice}"></td>
<td th:if="${item.product.getClass().getSimpleName() == 'Consumable' && item.product.promotionPrice.isPresent()}"><del th:text="${item.product.retailPrice}"></del> <span th:text="${item.product.promotionPrice.get()}"></span></td>
<td th:if="${item.product.getClass().getSimpleName() != 'Consumable' || item.product.promotionPrice.isEmpty()}" th:text="${item.product.price}"></td>
<td th:text="${item.product.wholesalePrice.multiply(item.quantity.getAmount())}"></td>
<td>
<a th:href="@{/inventory/edit/{id}(id=${item.product.id},type=${item.product.getClass().getSimpleName()})}"><button class="btn btn-warning">Bearbeiten</button></a>
<a th:href="@{/inventory/delete/{id}(id=${item.product.id})}"><button class="btn btn-danger">Entfernen</button></a>
</td>
</tr>
</tbody>
</table>
<a href="/inventory/add?type=Consumable"><button class="btn btn-primary">Verbrauchsmaterial hinzufügen</button></a>
<a href="/inventory/add?type=Rentable"><button class="btn btn-primary">Leihmaterial hinzufügen</button></a>
</div>
</body>
</html>