diff --git a/src/lib/ldb/staff/table/table-generator.svelte b/src/lib/ldb/staff/table/table-generator.svelte index 3371ce1..d8ead40 100644 --- a/src/lib/ldb/staff/table/table-generator.svelte +++ b/src/lib/ldb/staff/table/table-generator.svelte @@ -7,28 +7,17 @@ export let services: TrainServices[]; export let click: Function; - interface locationObject { - location: string; - via?: string; - } - function detail(event: any, rid: string, uid: string, tid: string) { const target = event.target; click(rid, uid, tid); } - async function formatLocations(locations: ServiceLocation[]): Promise { + async function formatLocations(locations: ServiceLocation[]): Promise { let tiplocs: string[] = []; for (const location of locations) { tiplocs.push(location.tiploc); } - let locationObj: locationObject = { - location: tiplocs.join(' & ') - }; - if (locations[0]['via']) { - locationObj.via = locations[0]['via']; - } - return locationObj; + return tiplocs.join(' & '); } async function classGenerator(service: TrainServices) { @@ -132,15 +121,11 @@ > {#await classGenerator(service) then classes} - {service.trainid} + {service.trainid} - {#await formatLocations(service.origin) then origin}{origin.location}{#if origin.via}
{origin.via}{/if}{/await} + {#await formatLocations(service.origin) then origin}{origin}{/await} - {#await formatLocations(service.destination) then dest}{dest.location}{#if dest.via}
{dest.via}{/if}{/await} + {#await formatLocations(service.destination) then dest}{dest}{/await} {service.platform || '-'} @@ -154,16 +139,22 @@ {/await} - + + + {#if service.destination?.[0]?.via}{service.destination[0].via}
{/if} {tocMap.get(service.operatorCode.toLowerCase()) || service.operatorCode} {#if service.length} | {service.length} carriages{/if} {#if service.delayReason}
- + + + {/if} {#if service.cancelReason}
- + + + {/if} @@ -187,9 +178,12 @@ .dataRow { font-family: ubuntu, monospace; - vertical-align: bottom; + vertical-align: top; cursor: pointer; font-size: 16px; + line-height: 1; + padding: 0; + margin: 0; } /* Table Columns */ @@ -219,8 +213,7 @@ color: yellow; } - td.to, - th.to { + td.to { text-align: right; } td.from, @@ -229,7 +222,7 @@ } td.time { font-size: 15px; - vertical-align: middle; + vertical-align: top; } .tableTxt { text-align: left; @@ -237,11 +230,17 @@ color: var(--second-text-color); vertical-align: top; font-size: 12px; + padding-bottom: 10px; + } + .delayTxt { + color: var(--main-warning-color); + } + .cancTxt { + color: var(--main-alert-color); } .via { - font-size: 10px; - margin-bottom: 0px; - padding: 0px; + color: yellow; + padding-left: 0px; } /* Handle small screens */ .smallScreen { @@ -300,7 +299,6 @@ /* Conditional Classes */ .loc.canc, - .id.canc, .canc { color: grey; text-decoration: line-through;