From 8c91a50a347b14c549a745ef92ab953cbbbc7c82 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 17 Apr 2024 12:20:50 +0100 Subject: [PATCH] Add non-passenger locations to train detail and prepare for 'pass' times to be made available from API. --- src/lib/train/train-detail.svelte | 40 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/lib/train/train-detail.svelte b/src/lib/train/train-detail.svelte index bbce088..0ae4a09 100644 --- a/src/lib/train/train-detail.svelte +++ b/src/lib/train/train-detail.svelte @@ -80,30 +80,29 @@ })}

+ - {#if serviceDetail.stops[0]['publicDeparture']} - {#each serviceDetail.stops as stop} - {#if stop.publicArrival || stop.publicDeparture} - - - - - - {/if} - {/each} - {:else} {#each serviceDetail.stops as stop} + {#if stop.publicArrival || stop.publicDeparture} - - + + + {:else if stop.wttArrival || stop.wttDeparture} + + + + {:else} + + + + {/if} {/each} - {/if}
Grey times are non-passenger stops, italics are 'pass' times
Location Sch Arr. Sch Dep.
{stop.tiploc}{stop.publicArrival || '-'}{stop.publicDeparture || '-'}
{stop.tiploc}{stop.wttArrival || '-'}{stop.wttDeparture || '-'}{stop.publicArrival || '-'}{stop.publicDeparture || '-'}{stop.tiploc}{stop.wttArrival || '-'}{stop.wttDeparture || '-'}{stop.tiploc}--
{/if} {:catch} @@ -167,10 +166,21 @@ } table { margin: auto; - padding-top: 10px; + padding-top: 5px; padding-bottom: 10px; color: var(--island-text-color); } + caption { + padding-top: 15px; + font-size: small; + } + .wtt { + opacity: 0.5; + } + .pass { + font-style: italic; + opacity: 0.5; + } .text-message { margin: 5px; margin-left: 20px;