mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Make only enabled customers able to be removed
This commit is contained in:
parent
ce06970972
commit
a11c23ab98
|
@ -59,6 +59,10 @@ public class User extends AbstractAggregateRoot<UserIdentifier> {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled(){
|
||||||
|
return userAccount.isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
@Embeddable
|
@Embeddable
|
||||||
public static final class UserIdentifier implements Identifier, Serializable {
|
public static final class UserIdentifier implements Identifier, Serializable {
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,10 @@
|
||||||
<td th:text="${customer.username}">Musterkoch</td>
|
<td th:text="${customer.username}">Musterkoch</td>
|
||||||
<td>Aufträge</td>
|
<td>Aufträge</td>
|
||||||
<td><a th:href="@{/customers/edit/{id}(id=${customer.id})}" class="button">Bearbeiten</a></td>
|
<td><a th:href="@{/customers/edit/{id}(id=${customer.id})}" class="button">Bearbeiten</a></td>
|
||||||
<td><a th:href="@{/customers/remove/{id}(id=${customer.id})}" class="button">Entfernen</a></td>
|
<td>
|
||||||
|
<a th:if="${customer.isEnabled}" th:href="@{/customers/remove/{id}(id=${customer.id})}" class="button">Entfernen</a>
|
||||||
|
<b th:if="${!customer.isEnabled}">Deaktiviert</b>
|
||||||
|
</td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue