updated form for edited all user

This commit is contained in:
2025-11-21 18:40:44 +01:00
parent 3b932f10d4
commit 230560dbbc
10 changed files with 161 additions and 61 deletions

View File

@@ -1,7 +1,6 @@
<nz-table [nzData]="users()"
[nzLoading]="usersLoading()"
[nzFrontPagination]="false"
>
[nzFrontPagination]="false">
<thead>
<tr style="text-align: center">
<th>Nom</th>
@@ -9,20 +8,19 @@
<th>Email</th>
<th>Anniversaire</th>
<th>Emprunt</th>
<th style="display: flex; align-items: center;">Action</th>
<th style="display: flex; align-items: center;">Action</th>
</tr>
</thead>
<tbody style="text-align: center">
@for (user of users(); track user.id) {
<tr>
<td>{{ user.name}}</td>
<td>{{ user.name }}</td>
<td>{{ user.firstName }}</td>
<td>{{ user.email }}</td>
<td>{{ user.birthDate | date: 'dd/MM/yyyy'}}</td>
<td>
<app-modal type="link" [name]="'Voir les emprunts'">
<nz-table [nzData]="users()"
[nzFrontPagination]="false">
<nz-table [nzData]="user.loans" [nzFrontPagination]="false">
<thead>
<tr style="text-align: center">
<th>Livre</th>
@@ -44,24 +42,22 @@
</td>
<td>
<div style="display: flex; align-items: center;">
<div class="cursor-pointer">
<app-modal-icon #modalIcon
nameIcon="edit"
[name]="'Modifier'"
(ok)="onModalOk(selectedUser?.id, updateUser, modalIcon)"
(cancel)="onModalCancel(modalIcon)"
(click)="openEditModal(user)">
<app-update-user #updateUser [user]="selectedUser"></app-update-user>
</app-modal-icon>
</div>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(user)">
</nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)" class="text-red-600 cursor-pointer">
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)"
class="text-red-600 cursor-pointer">
</nz-icon>
</div>
</td>
</tr>
}
</tbody>
</nz-table>
</nz-table>
<div class="hidden">
<app-modal-icon #modalIcon nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedUser?.id, updateUser, modalIcon)" (cancel)="onModalCancel(modalIcon)">
<app-update-user #updateUser [user]="selectedUser"></app-update-user>
</app-modal-icon>
</div>