
Co-authored-by: Phan Huy Tran <p.tran@neusta.de> Reviewed-on: http://git.simonis.lol/angular/ems-frontend/pulls/32 Reviewed-by: Constantin Simonis <constantin@simonis.lol>
98 lines
5.0 KiB
HTML
98 lines
5.0 KiB
HTML
<section class="!space-y-6 mb-6">
|
|
@defer {
|
|
@if (qualifications$ | async; as qualifications) {
|
|
<div class="!space-y-6">
|
|
<div class="!flex !justify-between !items-center">
|
|
<h2 class="!text-2xl !font-semibold !text-gray-900">Qualifications</h2>
|
|
<button mat-flat-button color="primary" class="!bg-blue-600 !text-white"
|
|
(click)="openCreateModal()">
|
|
<mat-icon class="!mr-2">add</mat-icon>
|
|
Create Qualification
|
|
</button>
|
|
</div>
|
|
|
|
@if (qualifications) {
|
|
<div class="!overflow-x-auto !rounded-lg !bg-gray-50 !p-4">
|
|
<table mat-table [dataSource]="qualifications" class="!w-full">
|
|
<ng-container matColumnDef="id">
|
|
<th mat-header-cell *matHeaderCellDef class="!text-left">ID</th>
|
|
<td mat-cell *matCellDef="let qualification" class="!py-4">{{ qualification.id }}</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="skill">
|
|
<th mat-header-cell *matHeaderCellDef class="!text-left">Skill</th>
|
|
<td mat-cell *matCellDef="let qualification" class="!py-4">
|
|
<a
|
|
class="!text-blue-600 hover:!underline cursor-pointer"
|
|
[matTooltip]="'Click to view qualification details'"
|
|
(click)="openDetailsModal(qualification)"
|
|
>
|
|
{{ qualification.skill }}
|
|
</a>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="actions">
|
|
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
|
<td mat-cell *matCellDef="let qualification" class="!py-4">
|
|
<button mat-icon-button color="primary" [matTooltip]="'Edit qualification'"
|
|
class="!mr-2" (click)="openEditModal(qualification)">
|
|
<mat-icon>edit</mat-icon>
|
|
</button>
|
|
<button mat-icon-button color="warn" [matTooltip]="'Delete qualification'"
|
|
(click)="openDeleteModal(qualification.id)">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
|
</table>
|
|
</div>
|
|
} @else {
|
|
<mat-card class="!text-center !py-8">
|
|
<mat-card-content>
|
|
<mat-icon class="!w-12 !h-12 !text-gray-400 !mb-4">school</mat-icon>
|
|
<p class="!text-gray-600">No qualifications found</p>
|
|
</mat-card-content>
|
|
</mat-card>
|
|
}
|
|
</div>
|
|
}
|
|
} @placeholder {
|
|
<div class="!space-y-6">
|
|
<div class="!animate-pulse">
|
|
<div class="!flex !justify-between !items-center !mb-8">
|
|
<div class="!h-8 !bg-gray-200 !rounded !w-1/4"></div>
|
|
<div class="!h-10 !bg-gray-200 !rounded !w-32"></div>
|
|
</div>
|
|
<div class="!bg-gray-50 !p-4 !rounded-lg">
|
|
<div class="!space-y-4">
|
|
<div class="!h-10 !bg-gray-200 !rounded"></div>
|
|
@for (i of [1, 2, 3]; track i) {
|
|
<div class="!h-16 !bg-white !rounded-lg !shadow-sm"></div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} @error {
|
|
<mat-card class="!bg-red-50 !border !border-red-100">
|
|
<mat-card-content class="!p-4">
|
|
<div class="!flex !items-center !gap-4 !text-red-800">
|
|
<mat-icon class="!text-red-500">error_outline</mat-icon>
|
|
<div>
|
|
<h3 class="!font-medium !mb-1">Error loading qualifications</h3>
|
|
<p class="!text-sm !text-red-700">Please try refreshing the page.</p>
|
|
</div>
|
|
</div>
|
|
</mat-card-content>
|
|
</mat-card>
|
|
} @loading {
|
|
<div class="!flex !justify-center !items-center !py-12">
|
|
<mat-spinner diameter="48" class="!text-blue-600"></mat-spinner>
|
|
</div>
|
|
}
|
|
</section>
|