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

69 lines
3.6 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">
<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 user of users">
<tr *ngIf="alertEnabled || user.response !== 'waiting'">
<td>
<img alt="red helmet" src="./assets/icons/red_helmet.png" width="20px" *ngIf="user.chief">
<img alt="red helmet" src="./assets/icons/black_helmet.png" width="20px" *ngIf="!user.chief">
{{ user.name }}
<img alt="driver" src="./assets/icons/wheel.png" width="20px" *ngIf="user.driver">
</td>
<ng-container *ngIf="user.response == 'waiting'">
<td style="width: 1px;"><i class="fas fa-spinner fa-spin"></i></td>
<td>In attesa di risposta</td>
</ng-container>
<ng-container *ngIf="user.response == true">
<td style="width: 1px;"><i class="fa fa-check" style="color:green"></i></td>
<td>Presente</td>
</ng-container>
<ng-container *ngIf="user.response == 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>
<ng-container *ngIf="auth.profile.hasRole('SUPER_EDITOR') && alertEnabled">
<button type="button" class="btn btn-primary mb-2" (click)="isAdvancedCollapsed = !isAdvancedCollapsed"
[attr.aria-expanded]="!isAdvancedCollapsed" aria-controls="collapseBasic">
<ng-container *ngIf="isAdvancedCollapsed">Mostra impostazioni avanzate</ng-container>
<ng-container *ngIf="!isAdvancedCollapsed">Nascondi impostazioni avanzate</ng-container>
</button>
<div [collapse]="isAdvancedCollapsed" [isAnimated]="true">
<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"></textarea>
<button class="btn btn-secondary mt-2" (click)="saveAlertSettings()">Salva</button>
</div>
</div>
</ng-container>
<ng-container *ngIf="(!auth.profile.hasRole('SUPER_EDITOR') && notes !== '') || !alertEnabled">
<div class="well well-lg card card-block card-header">
<h5>Dettagli allerta</h5>
<h2>{{ notes }}</h2>
</div>
</ng-container>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" (click)="deleteAlert()" *ngIf="auth.profile.hasRole('SUPER_EDITOR') && alertEnabled">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>