Skip to content

Commit

Permalink
Move headsign to top of component
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Feb 8, 2024
1 parent c2352a9 commit 1c08a65
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions src/components/vehicleselected.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@
fetchSwiftlyInformation();
});
//super jank, should replace with a backend api in Aspen soon
const SWIFTLY_KEYS: Record<string, string> = {
'f-octa~rt': 'octa',
"f-metro~losangeles~bus~rt": "lametro"
'f-metro~losangeles~bus~rt': 'lametro',
'f-metro~losangeles~rail~rt': 'lametro-rail',
'f-northcountrytransitdistrict~rt': 'nctd',
'f-bigbluebus~rt': 'big-blue-bus'
};
function fetchSwiftlyInformation(): void {
Expand Down Expand Up @@ -195,6 +199,16 @@
<p class="font-mono text-sm">{selectedVehicleLookup.realtime_feed_id}</p>
<p class="font-mono text-sm">ID: {selectedVehicleLookup.id}</p>

{#if swiftly != null}
{#if swiftly_fetch_metadata != null}
{#if swiftly_fetch_metadata.id === selectedVehicleLookup.id && swiftly_fetch_metadata.realtime_feed_id === selectedVehicleLookup.realtime_feed_id}
{#if swiftly.headsign}
<p>{swiftly.headsign}</p>
{/if}
{/if}
{/if}
{/if}

<!--
{#if selectedVehicleLookup.realtime_feed_id == 'f-mts~rt~onebusaway'}
<h1
Expand Down Expand Up @@ -402,18 +416,19 @@

{#if swiftly != null}
{#if swiftly_fetch_metadata != null}
{#if swiftly_fetch_metadata.id === selectedVehicleLookup.id && swiftly_fetch_metadata.realtime_feed_id === selectedVehicleLookup.realtime_feed_id}
{#if swiftly.headsign}
<p>{swiftly.headsign}</p>
{/if}
{#if swiftly.driver}
<p><b class="text-lg">{strings.driver}</b>: {swiftly.driver}</p>
{/if}
{#if swiftly.schAdhSecs}
<p><b class="text-lg">{strings.delay}</b>: {durationToIsoElapsed(Number (swiftly.schAdhSecs))}</p>
{/if}
{#if swiftly_fetch_metadata.id === selectedVehicleLookup.id && swiftly_fetch_metadata.realtime_feed_id === selectedVehicleLookup.realtime_feed_id}
{#if swiftly.driver}
<p><b class="text-lg">{strings.driver}</b>: {swiftly.driver}</p>
{/if}
{#if swiftly.schAdhSecs}
<p>
<b class="text-lg">{strings.delay}</b>: {durationToIsoElapsed(
Number(swiftly.schAdhSecs)
)}
</p>
{/if}
{/if}
{/if}
{/if}
{/if}

<div>
Expand Down

0 comments on commit 1c08a65

Please sign in to comment.