Add eslint

This commit is contained in:
2025-08-20 23:40:00 +02:00
parent cc544322b2
commit 16956d12f4
31 changed files with 1214 additions and 913 deletions
+105 -103
View File
@@ -10,112 +10,114 @@ watch(loggedIn, () => refresh());
</script>
<template>
<h1 class="text-primary text-3xl">{{ t('hello') }}</h1>
<VaButton icon="refresh" @click="refresh" :disabled="pending">{{
t('layouts.refresh')
}}</VaButton>
<div>
<h1 class="text-primary text-3xl">{{ t('hello') }}</h1>
<VaButton icon="refresh" :disabled="pending" @click="refresh">{{
t('layouts.refresh')
}}</VaButton>
<div v-if="data">
<div v-if="data.own !== null">
<h2 class="my-4 text-2xl font-bold">
{{ t('page.home.joined_hunts') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.own"
:key="hunt.id"
stripe
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
<div v-if="data">
<div v-if="data.own !== null">
<h2 class="my-4 text-2xl font-bold">
{{ t('page.home.joined_hunts') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.own"
:key="hunt.id"
stripe
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
<ClickableImage
v-if="hunt.picture"
:src="hunt.picture?.url"
:title="tKey(hunt, 'name').value"
/>
<VaCardContent>
<h3 class="text-xl">{{ tKey(hunt, 'name') }}</h3>
{{ tKey(hunt, 'description') }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, fullDate)
})
}}
</p>
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.own.length <= 0">
<VaCardTitle>{{ t('page.home.no_hunt_joined') }}</VaCardTitle>
<VaCardContent>{{
t('page.home.click_hunt_below_to_join')
}}</VaCardContent>
</VaCard>
<ClickableImage
v-if="hunt.picture"
:src="hunt.picture?.url"
:title="tKey(hunt, 'name').value"
/>
<VaCardContent>
<h3 class="text-xl">{{ tKey(hunt, 'name') }}</h3>
{{ tKey(hunt, 'description') }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, fullDate)
})
}}
</p>
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.own.length <= 0">
<VaCardTitle>{{ t('page.home.no_hunt_joined') }}</VaCardTitle>
<VaCardContent>{{
t('page.home.click_hunt_below_to_join')
}}</VaCardContent>
</VaCard>
</div>
</div>
</div>
<div v-else>
<VaButton color="info" icon="login" :to="$localePath(`/login`)">{{
t('page.home.login_first')
}}</VaButton>
</div>
<div class="mt-8">
<VaDivider />
<h2 class="my-4 text-2xl font-bold">
{{ t('page.home.open_to_join') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.others"
:key="hunt.id"
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
<ClickableImage
v-if="hunt.picture"
:src="hunt.picture?.url"
:title="tKey(hunt, 'name').value"
/>
<VaCardContent>
<h3 class="text-xl">{{ tKey(hunt, 'name') }}</h3>
{{ tKey(hunt, 'description') }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, fullDate)
})
}}
</p>
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.others.length <= 0">
<VaCardTitle>{{ t('page.home.no_hunt_created') }}</VaCardTitle>
<VaCardContent>{{ t('page.home.new_hunts_soon') }}</VaCardContent>
</VaCard>
<div v-else>
<VaButton color="info" icon="login" :to="$localePath(`/login`)">{{
t('page.home.login_first')
}}</VaButton>
</div>
<div class="mt-8">
<VaDivider />
<h2 class="my-4 text-2xl font-bold">
{{ t('page.home.open_to_join') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.others"
:key="hunt.id"
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
<ClickableImage
v-if="hunt.picture"
:src="hunt.picture?.url"
:title="tKey(hunt, 'name').value"
/>
<VaCardContent>
<h3 class="text-xl">{{ tKey(hunt, 'name') }}</h3>
{{ tKey(hunt, 'description') }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, fullDate)
})
}}
</p>
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.others.length <= 0">
<VaCardTitle>{{ t('page.home.no_hunt_created') }}</VaCardTitle>
<VaCardContent>{{ t('page.home.new_hunts_soon') }}</VaCardContent>
</VaCard>
</div>
</div>
</div>
</div>