Compare commits

...

4 Commits

Author SHA1 Message Date
a9ac49f6fa Season/Drivers: Display started_active in table
All checks were successful
Build Formula11 Docker Image / pocketbase-docker (push) Successful in 33s
2025-03-27 13:17:30 +01:00
0cd4129a6e Seasonpicks: Filter drivers (podiums/teamwinners) by started_active 2025-03-27 13:17:20 +01:00
eeae9fea6e Lib: Set started_active field for new driver in TeamSwitchCard 2025-03-27 13:17:05 +01:00
35af66c222 Lib: Add started_active field to Driver schema 2025-03-27 13:16:17 +01:00
4 changed files with 12 additions and 4 deletions

View File

@ -82,6 +82,7 @@
headshot: headshot_blob, // NOTE: Duplicates the image, but no issue for low volume
team: team_value,
active: true,
started_active: false,
};
try {
await pb.collection("drivers").create(new_driver_data);

View File

@ -41,6 +41,7 @@ export interface Driver {
headshot_url?: string;
team: string;
active: boolean;
started_active: boolean;
}
export interface Race {

View File

@ -59,6 +59,12 @@
valuefun: async (value: boolean): Promise<string> =>
`<span class='badge variant-filled-${value ? "tertiary" : "primary"} text-center' style='width: 36px;'>${value ? "Yes" : "No"}</span>`,
},
{
data_value_name: "started_active",
label: "Started Active",
valuefun: async (value: boolean): Promise<string> =>
`<span class='badge variant-filled-${value ? "tertiary" : "primary"} text-center' style='width: 36px;'>${value ? "Yes" : "No"}</span>`,
},
]);
</script>

View File

@ -366,8 +366,8 @@
? get_by_value(drivers, "id", pick.mostovertakes)
: undefined}
{@const mostdnfs = pick ? get_by_value(drivers, "id", pick.mostdnfs) : undefined}
{@const drivers_sorted = drivers
.filter((driver: Driver) => driver.active)
{@const drivers_startedactive = drivers
.filter((driver: Driver) => driver.started_active)
.sort((a: Driver, b: Driver) => a.code.localeCompare(b.code))
.sort((a: Driver, b: Driver) => a.team.localeCompare(b.team))}
@ -464,7 +464,7 @@
>
{#if pick && pick.teamwinners}
<div class="grid grid-cols-2 gap-1">
{#each drivers_sorted as driver}
{#each drivers_startedactive as driver}
{@const color: string = get_by_value(teams, "id", driver?.team ?? "")?.color ?? ""}
<div class="mx-auto w-fit text-xs lg:text-sm">
<div
@ -493,7 +493,7 @@
>
{#if pick && pick.podiums}
<div class="grid grid-cols-2 gap-1">
{#each drivers_sorted as driver}
{#each drivers_startedactive as driver}
{@const color: string = get_by_value(teams, "id", driver?.team ?? "")?.color ?? ""}
<div class="mx-auto w-fit text-xs lg:text-sm">
<div