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

46 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>
<section layout:fragment="content">
<table border>
<thead>
<!-- TODO: i18n? -->
<tr>
<th>ID</th> <!-- FIXME UUIDs are long -->
<th>Produktname</th>
<th>Menge</th>
<th>Einkaufspreis</th>
<th>UVP</th>
<th>Gesamtwert</th>
<th></th> <!-- FIXME: this should be replaced by something more reasonable once CSS comes into play -->
</tr>
</thead>
<tbody>
<tr th:each="item : ${inventory}">
<td th:text="${item.id}"></td>
<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.promotionPrice != null}"><del th:text="${item.product.price}"></del> <span th:text="${item.product.promotionPrice}"></span></td>
<td th:if="${item.product.promotionPrice == null}" 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})}"><button></button></a><a th:href="@{/inventory/delete/{id}(id=${item.product.id})}"><button>X</button></a></td>
</tr>
<tr>
<td><a href="/inventory/add"><button></button></a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td><!-- TODO (optional): add total monetary value of inventory -->
<td></td>
</tr>
</tbody>
</table>
</section>
</body>
</html>