From f30a2745d48bc8ac2d722b937976dd3e9c9f1966 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Mon, 18 May 2026 20:44:05 +0100 Subject: [PATCH] Add initial staff grid view --- .../ui/station-board/StaffServicesGrid.svelte | 431 ++++++++++++++++++ src/routes/board/+page.svelte | 3 +- 2 files changed, 433 insertions(+), 1 deletion(-) create mode 100644 src/lib/components/ui/station-board/StaffServicesGrid.svelte diff --git a/src/lib/components/ui/station-board/StaffServicesGrid.svelte b/src/lib/components/ui/station-board/StaffServicesGrid.svelte new file mode 100644 index 0000000..96e855d --- /dev/null +++ b/src/lib/components/ui/station-board/StaffServicesGrid.svelte @@ -0,0 +1,431 @@ + + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {#each services as service (getRowKey(service))} + + + + + + + + + {#if service.wtp} + + + + + {:else} + + + + + + + + + + {/if} + + + {#if service.o} + + + + {/if} + {#if service.c && service.cr?.r} + + + + {/if} + {#if service.dr?.r} + + + + {/if} + + {/each} +
ArrDep
IDOrigDestPltSchActSchAct
{service.h}{service.og.t}{service.dt.t}{service.p || '-'}Pass{formatUkTime(service.wtp)} + + {service.c + ? '-' + : delayClassFromTimePair(service.wtp, service.atp || service.etp) === 'delay-rt' + ? 'RT' + : formatUkTime(service.atp || service.etp)} + + {formatUkTime(service.sta)} + + {service.c + ? '-' + : delayClassFromTimePair(service.sta, service.ata || service.eta) === 'delay-rt' + ? 'RT' + : formatUkTime(service.ata || service.eta)} + + {formatUkTime(service.std)} + + {service.c + ? '-' + : delayClassFromTimePair(service.std, service.atd || service.etd) === 'delay-rt' + ? 'RT' + : formatUkTime(service.atd || service.etd)} + +
+ {service.o} +
+ {service.cr.r} + {#if service.cr.l} + {service.cr.n ? 'near' : 'at'} + {service.cr.l} + {/if} +
+ {service.dr.r} + {#if service.dr.l} + {service.dr.n ? 'near' : 'at'} + {service.dr.l} + {/if} +
+ + diff --git a/src/routes/board/+page.svelte b/src/routes/board/+page.svelte index 64f9bc2..bd929db 100644 --- a/src/routes/board/+page.svelte +++ b/src/routes/board/+page.svelte @@ -7,6 +7,7 @@ import { formatUkDateTime, formatUkTime } from '$lib/utils/time'; import StaffServicesTable from '$lib/components/ui/station-board/StaffServicesTable.svelte'; import LiveIndicator from '$lib/components/ui/LiveIndicator.svelte'; + import StaffServicesGrid from '$lib/components/ui/station-board/StaffServicesGrid.svelte'; let { data } = $props(); let now = $state(new Date()); @@ -127,7 +128,7 @@ $effect(() => { {/if} {#if data.boardData.data.s?.length}
- +
{/if}