Add find by headcode Card to PIS page
This commit is contained in:
parent
ec413b6e5c
commit
46c15f9601
14
src/lib/cards/FindByHeadcodeCard.svelte
Normal file
14
src/lib/cards/FindByHeadcodeCard.svelte
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import LookupCard from "./LookupCard.svelte";
|
||||||
|
|
||||||
|
const LookupCardConfig = {
|
||||||
|
title: "Find By Headcode",
|
||||||
|
helpText: "",
|
||||||
|
formAction: "/train",
|
||||||
|
placeholder: "enter headcode",
|
||||||
|
maxLen: 4,
|
||||||
|
fieldName: "headcode",
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<LookupCard config={LookupCardConfig} />
|
@ -9,6 +9,7 @@
|
|||||||
import type { OB_Pis_FullObject } from "@owlboard/ts-types";
|
import type { OB_Pis_FullObject } from "@owlboard/ts-types";
|
||||||
import Card from "$lib/cards/Card.svelte";
|
import Card from "$lib/cards/Card.svelte";
|
||||||
import type { CardConfig } from "$lib/cards/Card.types";
|
import type { CardConfig } from "$lib/cards/Card.types";
|
||||||
|
import FindByHeadcodeCard from "$lib/cards/FindByHeadcodeCard.svelte";
|
||||||
|
|
||||||
const title = "PIS Finder";
|
const title = "PIS Finder";
|
||||||
let entryPIS = "";
|
let entryPIS = "";
|
||||||
@ -96,14 +97,6 @@
|
|||||||
onRefresh: () => {},
|
onRefresh: () => {},
|
||||||
refreshing: false,
|
refreshing: false,
|
||||||
}
|
}
|
||||||
const findByHeadcodeCard: CardConfig = {
|
|
||||||
title: "Find by Headcode",
|
|
||||||
showHelp: true,
|
|
||||||
helpText: "Find by Headcode can be found on the homepage",
|
|
||||||
showRefresh: false,
|
|
||||||
onRefresh: () => {},
|
|
||||||
refreshing: false,
|
|
||||||
}
|
|
||||||
const findByStartEndCard: CardConfig = {
|
const findByStartEndCard: CardConfig = {
|
||||||
title: "Find by Start/End CRS",
|
title: "Find by Start/End CRS",
|
||||||
showHelp: true,
|
showHelp: true,
|
||||||
@ -147,12 +140,7 @@
|
|||||||
</Card>
|
</Card>
|
||||||
<button id="reset" type="reset" on:click={reset}>Reset</button>
|
<button id="reset" type="reset" on:click={reset}>Reset</button>
|
||||||
{:else}
|
{:else}
|
||||||
<Card config={findByHeadcodeCard}>
|
<FindByHeadcodeCard />
|
||||||
<span class="important">Find by Headcode from the homepage</span>
|
|
||||||
<br>
|
|
||||||
The tools below are more helpful if you've been diverted or are not starting your journey at your scheduled origin.
|
|
||||||
<br><br>
|
|
||||||
</Card>
|
|
||||||
<Card config={findByStartEndCard}>
|
<Card config={findByStartEndCard}>
|
||||||
<form on:submit={findByStartEnd}>
|
<form on:submit={findByStartEnd}>
|
||||||
<input type="text" maxlength="3" pattern="^[A-Za-z]+$" autocomplete="off" placeholder="Start" required bind:value={entryStartCRS} />
|
<input type="text" maxlength="3" pattern="^[A-Za-z]+$" autocomplete="off" placeholder="Start" required bind:value={entryStartCRS} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user