allerta-vvf/frontend/src/app/_components/table/table.component.html

122 lines
4.8 KiB
HTML
Raw Normal View History

2021-12-22 23:06:58 +01:00
<div id="list" class="table-responsive mt-4">
<table *ngIf="sourceType === 'list'" id="table" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
<th>Nome</th>
<th>Disponibile</th>
2021-12-29 15:38:16 +01:00
<ng-container *ngIf="auth.profile.full_viewer">
2021-12-22 23:06:58 +01:00
<th>Autista</th>
<th>Chiama</th>
<th>Interventi</th>
<th>Minuti disponibilità</th>
2021-12-27 19:58:38 +01:00
</ng-container>
2021-12-22 23:06:58 +01:00
</tr>
</thead>
<tbody id="table_body">
<tr *ngFor="let row of data">
<td>
2021-12-27 20:57:05 +01:00
<img alt="red helmet" src="./assets/icons/red_helmet.png" width="20px" *ngIf="row.chief">
<img alt="red helmet" src="./assets/icons/black_helmet.png" width="20px" *ngIf="!row.chief">
2021-12-27 14:43:01 +01:00
<ng-container *ngIf="(getTime() - row.online_time) < 30"><u>{{ row.name }}</u></ng-container>
<ng-container *ngIf="(getTime() - row.online_time) > 30">{{ row.name }}</ng-container>
2021-12-22 23:06:58 +01:00
</td>
2021-12-27 19:58:38 +01:00
<td (click)="onChangeAvailability(row.id, row.available ? 0 : 1)">
2021-12-22 23:06:58 +01:00
<i class="fa fa-check" style="color:green" *ngIf="row.available"></i>
<i class="fa fa-times" style="color:red" *ngIf="!row.available"></i>
</td>
2021-12-29 15:38:16 +01:00
<ng-container *ngIf="auth.profile.full_viewer">
2021-12-22 23:06:58 +01:00
<td>
2021-12-27 20:57:05 +01:00
<img alt="driver" src="./assets/icons/wheel.png" width="20px" *ngIf="row.driver">
2021-12-22 23:06:58 +01:00
</td>
<td>
<a href="tel:{{row.phone_number}}"><i class="fa fa-phone"></i></a>
</td>
<td>{{ row.services }}</td>
<td>{{ row.availability_minutes }}</td>
2021-12-27 19:58:38 +01:00
</ng-container>
2021-12-22 23:06:58 +01:00
</tr>
</tbody>
</table>
<table *ngIf="sourceType === 'logs'" id="table" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
<th>Azione</th>
<th>Interessato</th>
<th>Fatto da</th>
<th>Data e ora</th>
</tr>
</thead>
<tbody id="table_body">
<tr *ngFor="let row of data">
<td>{{ row.action }}</td>
<td>{{ row.changed }}</td>
<td>{{ row.editor }}</td>
2021-12-27 15:19:17 +01:00
<td>{{ row.timestamp }}</td>
2021-12-22 23:06:58 +01:00
</tr>
</tbody>
</table>
<table *ngIf="sourceType === 'services'" id="table" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
<th>Data</th>
<th>Codice</th>
<th>Tempo inizio</th>
<th>Tempo fine</th>
<th>Caposquadra</th>
<th>Autisti</th>
<th>Altre persone</th>
<th>Luogo</th>
<th>Note</th>
<th>Tipo</th>
<th>Modifica</th>
<th>Rimuovi</th>
</tr>
</thead>
<tbody id="table_body">
<tr *ngFor="let row of data">
<td>{{ row.date | date: 'MM/dd/yyyy HH:mm' }}</td>
<td>{{ row.code }}</td>
<td>{{ row.beginning }}</td>
<td>{{ row.end }}</td>
<td>{{ row.chief }}</td>
<td>{{ row.drivers }}</td>
<td>{{ row.crew }}</td>
<td>{{ row.place }}</td>
<td>{{ row.notes }}</td>
<td>{{ row.type }}</td>
<td><i class="fa fa-edit"></i></td>
<td><i class="fa fa-trash"></i></td>
</tr>
</tbody>
</table>
<table *ngIf="sourceType === 'trainings'" id="table" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
<th>Data</th>
<th>Nome</th>
<th>Tempo inizio</th>
<th>Tempo fine</th>
<th>Caposquadra</th>
<th>Altre persone</th>
<th>Luogo</th>
<th>Note</th>
<th>Modifica</th>
<th>Rimuovi</th>
</tr>
</thead>
<tbody id="table_body">
<tr *ngFor="let row of data">
<td>{{ row.date | date: 'MM/dd/yyyy HH:mm' }}</td>
<td>{{ row.name }}</td>
<td>{{ row.beginning }}</td>
<td>{{ row.end }}</td>
<td>{{ row.chief }}</td>
<td>{{ row.crew }}</td>
<td>{{ row.place }}</td>
<td>{{ row.notes }}</td>
<td><i class="fa fa-edit"></i></td>
<td><i class="fa fa-trash"></i></td>
</tr>
</tbody>
</table>
</div>