Add note when train is planned cancelled

This commit is contained in:
Fred Boniface 2024-02-05 20:10:11 +00:00
parent f5760acd47
commit b9f5f3dc1d

View File

@ -38,7 +38,7 @@
<span class="header"
><StylesToc toc={service?.operator || ''} />
{service?.stops[0]['publicDeparture'] || service?.stops[0]['wttDeparture']}
{service?.stops[0]['tiploc']} to {service?.stops[service['stops'].length - 1]['tiploc']}{#if (service?.vstp)}VSTP{/if}</span
{service?.stops[0]['tiploc']} to {service?.stops[service['stops'].length - 1]['tiploc']}{#if service?.vstp}VSTP{/if}</span
>
<span id="container-arrow" class:isExpanded>V</span>
</div>
@ -47,49 +47,54 @@
{#await getTrainByUID(service.trainUid)}
<LoadingText />
{:then serviceDetail}
<div class="detailOperator"><StylesToc toc={service?.operator || ''} full={true} /></div>
{#if serviceDetail.pis}
<p class="pis">PIS: <PisHandler pisObject={serviceDetail.pis} /></p>
{/if}
<p class="svc-detail">
Planned Type: {parseInt(serviceDetail.planSpeed) || '--'}mph {serviceDetail.powerType || 'Non-Rail vehicle'}
</p>
<p class="svc-detail">
Days Run: {serviceDetail?.daysRun.join(', ').toUpperCase() || 'Unknown'}
</p>
<p class="svc-detail validity">
Valid From: {new Date(serviceDetail.scheduleStartDate).toLocaleDateString('en-GB', {
timeZone: 'UTC'
})} - {new Date(serviceDetail.scheduleEndDate).toLocaleDateString('en-GB', {
timeZone: 'UTC'
})}
</p>
<table>
<tr>
<th>Location</th>
<th>Sch Arr.</th>
<th>Sch Dep.</th>
</tr>
{#if serviceDetail.stops[0]['publicDeparture']}
{#each serviceDetail.stops as stop}
{#if stop.publicArrival || stop.publicDeparture}
{#if serviceDetail.stpIndicator === 'C'}
This has been removed from the timetable for today<br />
It is likely another service is running in its place
{:else}
<div class="detailOperator"><StylesToc toc={service?.operator || ''} full={true} /></div>
{#if serviceDetail.pis}
<p class="pis">PIS: <PisHandler pisObject={serviceDetail.pis} /></p>
{/if}
<p class="svc-detail">
Planned Type: {parseInt(serviceDetail.planSpeed) || '--'}mph {serviceDetail.powerType || 'Non-Rail vehicle'}
</p>
<p class="svc-detail">
Days Run: {serviceDetail?.daysRun.join(', ').toUpperCase() || 'Unknown'}
</p>
<p class="svc-detail validity">
Valid From: {new Date(serviceDetail.scheduleStartDate).toLocaleDateString('en-GB', {
timeZone: 'UTC'
})} - {new Date(serviceDetail.scheduleEndDate).toLocaleDateString('en-GB', {
timeZone: 'UTC'
})}
</p>
<table>
<tr>
<th>Location</th>
<th>Sch Arr.</th>
<th>Sch Dep.</th>
</tr>
{#if serviceDetail.stops[0]['publicDeparture']}
{#each serviceDetail.stops as stop}
{#if stop.publicArrival || stop.publicDeparture}
<tr>
<td>{stop.tiploc}</td>
<td>{stop.publicArrival || '-'}</td>
<td>{stop.publicDeparture || '-'}</td>
</tr>
{/if}
{/each}
{:else}
{#each serviceDetail.stops as stop}
<tr>
<td>{stop.tiploc}</td>
<td>{stop.publicArrival || '-'}</td>
<td>{stop.publicDeparture || '-'}</td>
<td>{stop.wttArrival || '-'}</td>
<td>{stop.wttDeparture || '-'}</td>
</tr>
{/if}
{/each}
{:else}
{#each serviceDetail.stops as stop}
<tr>
<td>{stop.tiploc}</td>
<td>{stop.wttArrival || '-'}</td>
<td>{stop.wttDeparture || '-'}</td>
</tr>
{/each}
{/if}
</table>
{/each}
{/if}
</table>
{/if}
{:catch}
<p>Unable to fetch train data</p>
{/await}