WIP staff pt

This commit is contained in:
2025-11-02 22:36:28 +01:00
parent 8b0d2f9203
commit e43cbbf9e4
4 changed files with 152 additions and 17 deletions
@@ -1 +1,40 @@
<p>staff-pt works!</p>
<div class="staff-pt-container">
<div class="week-header">
<button mat-icon-button (click)="prevWeek()" matTooltip="Previous week" aria-label="Previous week">
<mat-icon>chevron_left</mat-icon>
</button>
<div class="week-title">{{ weekLabel() }}</div>
<button mat-icon-button (click)="nextWeek()" [disabled]="!canGoNextWeek()"
matTooltip="Next week" aria-label="Next week">
<mat-icon>chevron_right</mat-icon>
</button>
</div>
<table mat-table [dataSource]="staffPt()" class="mat-elevation-z2 full-width">
<ng-container matColumnDef="staff_member">
<th mat-header-cell *matHeaderCellDef> Staff Member</th>
<td mat-cell *matCellDef="let row"> {{ row.staff_member }}</td>
</ng-container>
<ng-container matColumnDef="playtime">
<th mat-header-cell *matHeaderCellDef> Playtime (h:mm)</th>
<td mat-cell *matCellDef="let row"> {{ minutesToHm(row.playtime) }}</td>
</ng-container>
<ng-container matColumnDef="last_played">
<th mat-header-cell *matHeaderCellDef> Last Played</th>
<td mat-cell *matCellDef="let row"> {{ row.last_played | date:'medium' }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
@if (!staffPt()?.length) {
<tr class="no-data">
<td colspan="3">No data for this week.</td>
</tr>
}
</table>
</div>