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

126 lines
5.4 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>
2022-02-25 00:52:43 +01:00
<th>{{ 'name'|translate|titlecase }}</th>
<th>{{ 'available'|translate|titlecase }}</th>
<th>{{ 'driver'|translate|titlecase }}</th>
2022-02-10 09:46:40 +01:00
<ng-container *ngIf="auth.profile.hasRole('SUPER_EDITOR')">
2022-02-25 00:52:43 +01:00
<th>{{ 'call'|translate|titlecase }}</th>
2022-01-08 00:09:10 +01:00
</ng-container>
2022-02-25 00:52:43 +01:00
<th>{{ 'services'|translate|titlecase }}</th>
<th>{{ 'availability_minutes'|translate|titlecase }}</th>
2021-12-22 23:06:58 +01:00
</tr>
</thead>
<tbody id="table_body">
<tr *ngFor="let row of data">
<td>
2022-02-24 22:21:06 +01:00
<i *ngIf="auth.profile.hasRole('SUPER_ADMIN') && row.id !== auth.profile.auth_user_id" class="fa fa-user me-2" (click)="onUserImpersonate(row.id)"></i>
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>
<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>
2022-02-10 09:46:40 +01:00
<td *ngIf="auth.profile.hasRole('SUPER_EDITOR')">
2021-12-22 23:06:58 +01:00
<a href="tel:{{row.phone_number}}"><i class="fa fa-phone"></i></a>
</td>
<td>{{ row.services }}</td>
<td>{{ row.availability_minutes }}</td>
</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>
2022-02-24 23:16:09 +01:00
<th>#</th>
2022-01-09 14:31:19 +01:00
<th>Inizio</th>
<th>Fine</th>
2022-01-10 00:56:00 +01:00
<th>Codice</th>
2021-12-22 23:06:58 +01:00
<th>Caposquadra</th>
<th>Autisti</th>
<th>Altre persone</th>
<th>Luogo</th>
<th>Note</th>
<th>Tipo</th>
2022-02-24 23:41:46 +01:00
<th>Modifica</th>
2021-12-22 23:06:58 +01:00
<th>Rimuovi</th>
</tr>
</thead>
<tbody id="table_body">
2022-02-24 23:16:09 +01:00
<tr *ngFor="let row of data; index as i">
<td>{{ data.length - i }}</td>
2022-01-25 22:35:26 +01:00
<td>{{ row.start | date:'dd/MM/YYYY, HH:mm' }}</td>
<td>{{ row.end | date:'dd/MM/YYYY, HH:mm' }}</td>
2021-12-22 23:06:58 +01:00
<td>{{ row.code }}</td>
<td>{{ row.chief }}</td>
<td>{{ row.drivers }}</td>
<td>{{ row.crew }}</td>
2022-02-24 23:16:09 +01:00
<td>
{{ row.place_name }}<br>
<a class="place_details_link cursor-pointer" (click)="openPlaceDetails(row.lat, row.lng)">Altre informazioni</a>
</td>
2021-12-22 23:06:58 +01:00
<td>{{ row.notes }}</td>
<td>{{ row.type }}</td>
2022-02-24 23:41:46 +01:00
<td (click)="editService(row.id)"><i class="fa fa-edit"></i></td>
2022-01-11 13:33:39 +01:00
<td (click)="deleteService(row.id)"><i class="fa fa-trash"></i></td>
2021-12-22 23:06:58 +01:00
</tr>
</tbody>
</table>
<table *ngIf="sourceType === 'trainings'" id="table" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
2022-02-24 23:16:09 +01:00
<td>#</td>
2021-12-22 23:06:58 +01:00
<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>
2022-01-12 00:25:44 +01:00
<th hidden>Modifica</th>
<th hidden>Rimuovi</th>
2021-12-22 23:06:58 +01:00
</tr>
</thead>
<tbody id="table_body">
2022-02-24 23:16:09 +01:00
<tr *ngFor="let row of data; index as i">
<td>{{ data.length - i }}</td>
2021-12-22 23:06:58 +01:00
<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>
2022-01-12 00:25:44 +01:00
<td hidden><i class="fa fa-edit"></i></td>
<td hidden><i class="fa fa-trash"></i></td>
2021-12-22 23:06:58 +01:00
</tr>
</tbody>
</table>
</div>