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

41 lines
1.6 KiB
HTML
Raw Normal View History

2023-11-05 16:11:36 +01:00
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
2023-11-13 20:09:39 +01:00
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Inventar')}">
2023-11-05 16:11:36 +01:00
<body>
2023-11-15 17:27:04 +01:00
<div layout:fragment="content">
<table class="table">
2023-11-13 20:09:39 +01:00
<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>
2023-11-15 17:27:04 +01:00
<td>
<a th:href="@{/inventory/edit/{id}(id=${item.product.id})}"><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>
2023-11-13 20:09:39 +01:00
</tr>
</tbody>
</table>
2023-11-15 17:27:04 +01:00
<a href="/inventory/add"><button class="btn btn-primary">Artikel hinzufügen</button></a>
</div>
2023-11-05 16:11:36 +01:00
</body>
</html>