Files
library-frontend/src/app/components/user-table/user-table.html

60 lines
2.4 KiB
HTML

<nz-table [nzData]="users()"
[nzLoading]="usersLoading()"
[nzFrontPagination]="false"
>
<thead>
<tr style="text-align: center">
<th>Nom</th>
<th>Prénom</th>
<th>Email</th>
<th>Anniversaire</th>
<th>Emprunt</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.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">
<thead>
<tr style="text-align: center">
<th>Livre</th>
<th>Date d'enregistrement</th>
<th>Date de retour finale</th>
</tr>
</thead>
<tbody style="text-align: center">
@for (loan of user.loans; track loan.id) {
<tr>
<td>{{ loan.bookTitle }}</td>
<td>{{ loan.date | date: 'dd/MM/yyyy' }}</td>
<td>{{ loan.effectiveReturningDate | date: 'dd/MM/yyyy'}}</td>
</tr>
}
</tbody>
</nz-table>
</app-modal>
</td>
<td>
<div style="display: flex; align-items: center;">
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
<app-update-user></app-update-user>
</app-modal-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="text-red-600">
</nz-icon>
</div>
</td>
</tr>
}
</tbody>
</nz-table>