allerta-vvf/frontend/src/app/_components/modal-alert/modal-alert.component.html

62 lines
3.3 KiB
HTML

<div class="modal-header">
<h4 class="modal-title pull-left">Stato dell'allerta</h4>
<button type="button" class="btn-close close pull-right" [attr.aria-label]="'close'|translate|titlecase" (click)="bsModalRef.hide()">
<span aria-hidden="true" class="visually-hidden">&times;</span>
</button>
</div>
<div class="modal-body" *ngIf="id == 0">
<div class="d-flex justify-content-center mt-2 pt-2 mb-3">
<div class="spinner spinner-border"></div>
</div>
</div>
<div class="modal-body" *ngIf="id !== 0">
<div class="alert alert-danger" role="alert" *ngIf="alertClosed">
<i class="fas fa-exclamation-triangle"></i> Allerta conclusa
</div>
<table class="table table-border table-striped w-100">
<thead>
<tr>
<td>Nome</td>
<td colspan="2">Stato risposta</td>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let crewUser of crewUsers">
<tr>
<td>
<img alt="red helmet" src="./assets/icons/red_helmet.png" width="20px" *ngIf="crewUser.user.chief">
<img alt="red helmet" src="./assets/icons/black_helmet.png" width="20px" *ngIf="!crewUser.user.chief">
{{ crewUser.user.name }}
<img alt="driver" src="./assets/icons/wheel.png" width="20px" *ngIf="crewUser.user.driver">
</td>
<ng-container *ngIf="crewUser.accepted == null && alertClosed">
<td style="width: 1px;"><i class="fa fa-times" style="color:red"></i></td>
<td>Nessuna risposta</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == null && !alertClosed">
<td style="width: 1px;"><i class="fas fa-spinner fa-spin"></i></td>
<td>In attesa di risposta</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == true">
<td style="width: 1px;"><i class="fa fa-check" style="color:green"></i></td>
<td>Presente</td>
</ng-container>
<ng-container *ngIf="crewUser.accepted == false">
<td style="width: 1px;"><i class="fa fa-times" style="color:red"></i></td>
<td>Non presente</td>
</ng-container>
</tr>
</ng-container>
</tbody>
</table>
<div class="well well-lg card card-block card-header">
<label for="details" class="form-label">Dettagli allerta</label>
<textarea class="form-control" id="details" rows="3"
[(ngModel)]="notes" [disabled]="!auth.profile.can('users-read') || alertClosed==1" (keyup)="notesUpdated()"></textarea>
<button class="btn btn-secondary mt-2" (click)="saveAlertSettings()" [disabled]="!auth.profile.can('users-read') || !notesHasUnsavedChanges || alertClosed">Salva</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" (click)="deleteAlert()" *ngIf="auth.profile.can('users-read') && !alertClosed">Rimuovi allerta corrente <i class="fas fa-exclamation-triangle"></i></button>
<button type="button" class="btn btn-secondary" (click)="bsModalRef.hide()">{{ 'close'|translate }}</button>
</div>