Update order template only allow values COMPLETED or CANCELED

This commit is contained in:
Theo Reichert 2023-12-16 13:25:32 +01:00
parent ea78ec93b7
commit da24ca79a1

View file

@ -12,9 +12,15 @@ SPDX-FileCopyrightText: 2023 swt23w23
<div> <!--th:unless"${cart.empty}"-->
<form sec:authorize="hasRole('ADMIN')" method="get" th:action="@{/allOrders}" th:object="${form}" class="mb-3">
<label class="form-label">Bestellungsstatus</label>
<select class="form-select" for="orderStatus" th:field="*{orderStatus}" th:errorclass="is-invalid">
<select class="form-select mb-2" for="orderStatus" th:field="*{orderStatus}" th:errorclass="is-invalid">
<option selected name="orderStatus" th:value="${null}" th:text="any"></option>
<option th:each="orderStatus : ${T(org.salespointframework.order.OrderStatus).values()}" name="orderStatus" th:value="${orderStatus}" th:text="${orderStatus.toString().replace('_','-').toLowerCase()}"/>
<option
th:each="orderStatus : ${T(org.salespointframework.order.OrderStatus).values()}"
th:if="${orderStatus == T(org.salespointframework.order.OrderStatus).COMPLETED || orderStatus == T(org.salespointframework.order.OrderStatus).CANCELED}"
name="orderStatus"
th:value="${orderStatus}"
th:text="${orderStatus.toString().replace('_','-').toLowerCase()}"
/>
</select>
<div th:if="${#fields.hasErrors('orderStatus')}" class="invalid-feedback">Ungültiger Buchungsstatus.</div>
<button class="btn btn-primary" type="submit" th:text="${'suchen'}"></button>