Skip to content

Commit a8b6bf7

Browse files
committed
Added an indication to the tour list indicating if a tour had a training event.
1 parent 3bc105f commit a8b6bf7

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/routes/entry/tour/[id]/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const load = async ({ fetch, params, url }) => {
2525

2626
const entrySettings = await settings.getSet('entry');
2727

28-
const tours = await prisma.tour.findMany({ select: { id: true, startTime_utc: true, endTime_utc: true, _count: true }, orderBy: { startTime_utc: 'desc' } });
28+
const tours = await prisma.tour.findMany({ select: { id: true, startTime_utc: true, endTime_utc: true, _count: true, trainingEvent: true }, orderBy: { startTime_utc: 'desc' } });
2929

3030
let tour: Prisma.TourGetPayload<{
3131
include: { days: { include: { legs: { include: { positions: true } } } } }

src/routes/entry/tour/[id]/+page.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import * as Entry from '$lib/components/entry';
1515
import { dateToDateStringForm, dateToDateStringFormMonthDayYear, getInlineDateUTC } from '$lib/helpers';
1616
import * as Deck from '$lib/components/map/deck';
17-
import { ArrowRight, Timer, TowerControl } from 'lucide-svelte';
17+
import { ArrowRight, BookCheck, Timer, TowerControl } from 'lucide-svelte';
1818
import MenuSection from '$lib/components/menuForm/MenuSection.svelte';
1919
import MenuElement from '$lib/components/menuForm/MenuElement.svelte';
2020
import { TourPreview } from '$lib/components/tourPreview';
@@ -94,7 +94,7 @@
9494
{#each data.tours as tour (tour.id)}
9595
<MenuElement href="/entry/tour/{tour.id}?{urlActiveParam}" selected={tour.id === data.id && !isMobileSize}>
9696
<div class="flex flex-col gap-1 w-full overflow-hidden pl-2 mr-5 flex-initial font-medium text-xs">
97-
<div class="inline-flex overflow-hidden whitespace-nowrap text-ellipsis">
97+
<div class="inline-flex overflow-hidden whitespace-nowrap text-ellipsis items-center">
9898
<span class="text-sky-600 w-20">{dateToDateStringFormMonthDayYear(tour.startTime_utc)}</span>
9999
<span class="mx-2 text-xxs">→</span>
100100
<span class="ml-1 text-sky-600 w-20">
@@ -109,6 +109,9 @@
109109
<Tag>UNSAVED</Tag>
110110
{/if}
111111
</span>
112+
{#if tour.trainingEvent === true}
113+
<BookCheck class="w-3 h-3 text-green-500" />
114+
{/if}
112115
<span class="mx-2 text-xxs">
113116
{tour._count.days + ' '}
114117
{#if tour._count.days === 1}

0 commit comments

Comments
 (0)