diff --git a/src/lib/ldb/staff/train-detail.svelte b/src/lib/ldb/staff/train-detail.svelte index e58cc8d..39ad778 100644 --- a/src/lib/ldb/staff/train-detail.svelte +++ b/src/lib/ldb/staff/train-detail.svelte @@ -3,6 +3,7 @@ import { fade } from 'svelte/transition'; import Reason from '$lib/raw-fetchers/reason.svelte'; import { uuid } from '$lib/stores/uuid'; + import StylesToc from '$lib/train/styles-toc.svelte'; export let detail = { uid: '', rid: '', @@ -102,7 +103,7 @@
{detail.headcode}

Loading Data...

{:then train} -
{train.GetServiceDetailsResult.operatorCode}: {detail.headcode}
+
{detail.headcode}

Locations in grey are not scheduled stops
diff --git a/src/lib/stores/tocMap.js b/src/lib/stores/tocMap.js new file mode 100644 index 0000000..e9e1e05 --- /dev/null +++ b/src/lib/stores/tocMap.js @@ -0,0 +1,40 @@ +const tocMap = { + gw: 'Great Western Railway', + sw: 'South Western Railway', + id: 'Island Line', + nt: 'Northern', + aw: 'Transport for Wales', + cc: 'c2c', + cs: 'Caledonian Sleeper', + ch: 'Chiltern Railways', + xc: 'CrossCountry', + em: 'East Midlands Railway', + es: 'Eurostar', + ht: 'Hull Trains', + tl: 'Thameslink', + gc: 'Grand Central', + hx: 'Heathrow Express', + ls: 'Locomotive Services Limited', + me: 'Merseyrail', + lr: 'Network Rail OTM', + xr: 'TfL Elizabeth Line', + se: 'SouthEastern', + sn: 'Southern', + le: 'Greater Anglia', + lm: 'West Midlands Railway', + sr: 'ScotRail', + gn: 'Great Northern', + lt: 'TfL London Underground', + lo: 'TfL London Overground', + sj: 'Sheffield SuperTram', + tp: 'TransPennine Express', + vt: 'Avanti West Coast', + gr: 'LNER', + wc: 'West Coast Railway', + ty: 'Vintage Trains', + ld: 'Lumo', + so: 'Rail Adventure', + ln: 'Grand Union Trains' +}; + +export default tocMap; \ No newline at end of file diff --git a/src/lib/train/styles-toc.svelte b/src/lib/train/styles-toc.svelte new file mode 100644 index 0000000..56e132c --- /dev/null +++ b/src/lib/train/styles-toc.svelte @@ -0,0 +1,178 @@ + + +{text} + + \ No newline at end of file diff --git a/src/lib/train/train-detail.svelte b/src/lib/train/train-detail.svelte index 3175f2e..16cf9af 100644 --- a/src/lib/train/train-detail.svelte +++ b/src/lib/train/train-detail.svelte @@ -2,6 +2,7 @@ import { fly } from 'svelte/transition'; import { uuid } from '$lib/stores/uuid'; import LoadingText from '$lib/navigation/loading-text.svelte'; + import StylesToc from './styles-toc.svelte'; export let service = ''; @@ -33,7 +34,7 @@

{service?.operator || ''}: {service?.stops[0]['publicDeparture'] || service?.stops[0]['wttDeparture']} + > {service?.stops[0]['publicDeparture'] || service?.stops[0]['wttDeparture']} {service?.stops[0]['tiploc']} to {service?.stops[service['stops'].length - 1]['tiploc']} V @@ -43,6 +44,7 @@ {#await getTrainByUID(service.trainUid)} {:then serviceDetail} +
{#if serviceDetail.pis}

PIS: {serviceDetail.pis}

{/if} @@ -123,13 +125,18 @@ padding: 0; position: absolute; right: 16px; - top: 13px; + top: 10px; transition-duration: 300ms; z-index: 2; } .isExpanded { transform: rotate(180deg); } + .detailOperator { + padding-top: 15px; + margin-bottom: 15px; + font-weight: 600; + } .pis { font-size: 18px; font-weight: 600;