All files / src/app/components/administrator administrator.component.html

100% Statements 69/69
100% Branches 6/6
100% Functions 0/0
100% Lines 29/29

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43  8x     124x   124x     4x 4x 4x 4x 4x 4x 4x 4x   8x   114x 114x 114x 114x 6x 54x 6x 6x 54x 6x 6x 108x 36x   6x 18x     6x     8x  
 
<h1 class="title">Administration Panel</h1>
 
<div class="container">
    <p-table [value]="users" [tableStyle]="{ 'min-width': '50rem' }" [paginator]="true" [rows]="10"
    [rowsPerPageOptions]="[10, 20, 50]" [showCurrentPageReport]="true"
    currentPageReportTemplate="{first} - {last} of {totalRecords} signals" [rowHover]="true">
        <ng-template #header>
            <tr>
                <th pSortableColumn="lastname">Lastname <p-sortIcon field="lastname"></p-sortIcon></th>
                <th pSortableColumn="firstname">Firstname <p-sortIcon field="firstname"></p-sortIcon></th>
                <th pSortableColumn="email">Email <p-sortIcon field="email"></p-sortIcon></th>
                <th pSortableColumn="company_id">Company <p-sortIcon field="company_id"></p-sortIcon></th>
                <th pSortableColumn="is_active">Status <p-sortIcon field="is_active"></p-sortIcon></th>
                <th pSortableColumn="is_admin">Role <p-sortIcon field="is_admin"></p-sortIcon></th>
                <th>Action</th>
            </tr>
        </ng-template>
        <ng-template #body let-users>
            <tr>
                <td>{{ users.lastname }}</td>
                <td>{{ users.firstname }}</td>
                <td>{{ users.email }}</td>
                <td>{{ users.company_id }}</td>
                <td>
                    <p-tag [value]="getStatus(users.is_active)" [severity]="users.is_active ? 'warn' : 'success' " />
                </td>
                <td>
                    <p-tag [value]="getRole(users.is_admin)" [severity]="users.is_admin ? 'contrast' : 'info' " />
                </td>
                <td>
                    @if (this.actualUserId !== users.id) {
                        <a href="#" [routerLink]="['/users/', users.id]" class="pi pi-pen-to-square"><i class="fa fa-edit edit"></i></a>
                    }
                    @else {
                        <a href="#" [routerLink]="['/profile']" class="pi pi-pen-to-square"><i class="fa fa-edit edit"></i></a>
                    }
                </td>
            </tr>
        </ng-template>
    </p-table>
</div>