Translate invite code and start help page

This commit is contained in:
2025-08-30 17:31:19 +02:00
parent c2c52dbe45
commit e763e3adf0
5 changed files with 195 additions and 57 deletions
+9 -1
View File
@@ -132,7 +132,15 @@
"no_picture_uploaded": "Kein Bild hochgeladen", "no_picture_uploaded": "Kein Bild hochgeladen",
"admin_unreviewed": "Admin ({count} unbewertet)", "admin_unreviewed": "Admin ({count} unbewertet)",
"quest_not_revealed": "Quests wurden noch nicht aufgedeckt!", "quest_not_revealed": "Quests wurden noch nicht aufgedeckt!",
"quest_soon_reveal": "Bald werden alle {count} Quests aufgedeckt!" "quest_soon_reveal": "Bald werden alle {count} Quests aufgedeckt!",
"invite_toast_title": "Einladungscode",
"invite_toast_message": "Einladungscode wurde in deine Zwischenablage kopiert! Teile ihn mit deinen neuen Teammitgliedern.",
"invite_toast_text": "Trete dem Team {team} mit dem Code \"{code}\" im Hunt \"{hunt}\" bei!"
},
"help": {
"title": "Hilfe",
"subtitle": "Hier sind einige Themen und Wörter erklärt. Wenn du weiterhin Fragen hast, wende dich bitte ans Admin Team!",
"head": "PicHunt Hilfe"
} }
}, },
"validation": { "validation": {
+9 -1
View File
@@ -132,7 +132,15 @@
"no_picture_uploaded": "No picture uploaded", "no_picture_uploaded": "No picture uploaded",
"admin_unreviewed": "Admin ({count} unreviewed)", "admin_unreviewed": "Admin ({count} unreviewed)",
"quest_not_revealed": "Quests not revealed yet!", "quest_not_revealed": "Quests not revealed yet!",
"quest_soon_reveal": "Soon all {count} quests will be revealed!" "quest_soon_reveal": "Soon all {count} quests will be revealed!",
"invite_toast_title": "Invite code",
"invite_toast_message": "Invite code was copied to your clipboard! Share it with your next team mates.",
"invite_toast_text": "Join team {team} with code \"{code}\" on hunt \"{hunt}\"!"
},
"help": {
"title": "Help",
"subtitle": "Here are some topics and words explained. If you still have questions, please contact the Admin Team!",
"head": "PicHunt Help"
} }
}, },
"validation": { "validation": {
+10
View File
@@ -35,6 +35,16 @@ const slugs = computed(() => checkSlug(route.params));
<template #center> <template #center>
{{ titleStore.title || t('layouts.default_tile') }}</template {{ titleStore.title || t('layouts.default_tile') }}</template
> >
<template #right>
<VaButton
round
icon="help"
:to="$localePath('/help')"
title="Help"
:preset="$localePath('/help') === route.path ? 'secondary' : ''"
:border-color="$localePath('/help') === route.path ? 'primary' : ''"
/>
</template>
</VaNavbar> </VaNavbar>
</template> </template>
+90
View File
@@ -0,0 +1,90 @@
<script setup lang="ts">
import { useTitleStore } from '~/stores/title';
const { t } = useI18n();
const titleStore = useTitleStore();
useHead({
title: t('layouts.title', {
title: t('page.help.title')
})
});
titleStore.title = t('page.help.head');
// TODO: add help texts
</script>
<template>
<div>
<h1 class="text-3xl">
{{ t('page.help.title') }}
</h1>
<p>
{{ t('page.help.subtitle') }}
</p>
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard>
<VaCardTitle>PicHunt</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>tolle seite für fotosafaris</p>
</VaCardContent>
</VaCard>
<VaCard>
<VaCardTitle>Hunts</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>haben meistens zeitrahmen</p>
<p>abgaben danach können evtl nicht bewertet werden</p>
</VaCardContent>
</VaCard>
<VaCard>
<VaCardTitle>Teams</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>anmeldung pro user erforderlich!</p>
<p>dann einladecode an user teilen und beitreten</p>
<p>im team gemeinsam antworten abgeben</p>
<p>bei problemen admins ansprechen</p>
</VaCardContent>
</VaCard>
<VaCard>
<VaCardTitle>Quests</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>aufgabe, die mit foto zu lösen ist</p>
<p>manchmal ist auch antwortstext erforderlich</p>
<p>
manchmal gibts extra punkte, dann steht erklärt nach welchen
kriterien die vergeben werden
</p>
</VaCardContent>
</VaCard>
<VaCard stripe stripe-color="primary">
<VaCardTitle>Answers</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>zusammen an antwort feilen "zwischenspeichern"</p>
<p>wird erst bewertet wenn finalisiert, dann nicht mehr änderbar</p>
</VaCardContent>
</VaCard>
<VaCard color="info">
<VaCardTitle>Reviews</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>
admin team bewertet über den zeitraum alle finalisierten antworten
</p>
<p>vergibt punkte und prüft auf richtige antworten</p>
</VaCardContent>
</VaCard>
<VaCard>
<VaCardTitle>Showcase</VaCardTitle>
<VaCardContent class="flex flex-col gap-2">
<p>
nach Hunt gibt es showcase der besten antworten und siegerehrung
</p>
</VaCardContent>
</VaCard>
</div>
</div>
</template>
+77 -55
View File
@@ -7,6 +7,7 @@ const app = useNuxtApp();
const { loggedIn } = useUserSession(); const { loggedIn } = useUserSession();
const { t, d } = useI18n(); const { t, d } = useI18n();
const { tKey, hasKey, tSluggy } = useI18nKey(); const { tKey, hasKey, tSluggy } = useI18nKey();
const { init } = useToast();
const { name, id } = app.$slugData.huntSlug!; const { name, id } = app.$slugData.huntSlug!;
@@ -30,14 +31,26 @@ async function invite() {
if (!data.value?.ownTeam) { if (!data.value?.ownTeam) {
return; return;
} }
const clipboardItemData = { const clipboardItemData = {
// TODO: add invite link // TODO: add invite link
// 'text/plain': `https://pichunt.syma.dev/hunt/${id}/join?id=${data.value.ownTeam.id}&pw=${data.value.ownTeam.password}` // 'text/plain': `https://pichunt.syma.dev/hunt/${id}/join?id=${data.value.ownTeam.id}&pw=${data.value.ownTeam.password}`
'text/plain': `Join team ${data.value.ownTeam.name} with code "${data.value.ownTeam.password}" on hunt "${data.value ? tKey(data.value, 'name').value : name}"!` 'text/plain': `${t('page.hunt.invite_toast_text', {
team: data.value.ownTeam.name,
code: data.value.ownTeam.password,
hunt: data.value ? tKey(data.value, 'name').value : name
})}
${document.location.href}`
}; };
const clipboardItem = new ClipboardItem(clipboardItemData); const clipboardItem = new ClipboardItem(clipboardItemData);
await navigator.clipboard.write([clipboardItem]); await navigator.clipboard.write([clipboardItem]);
init({
title: t('page.hunt.invite_toast_title'),
message: t('page.hunt.invite_toast_message'),
color: 'success',
duration: 2000
});
} }
</script> </script>
@@ -47,7 +60,7 @@ async function invite() {
{{ data ? tKey(data, 'name') : name }} {{ data ? tKey(data, 'name') : name }}
<VaChip v-if="data?.totalScore" class="float-right" color="success">{{ <VaChip v-if="data?.totalScore" class="float-right" color="success">{{
t('page.hunt.total_points', data!!.totalScore) t('page.hunt.total_points', { score: data!!.totalScore })
}}</VaChip> }}</VaChip>
</h1> </h1>
<div class="grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6"> <div class="grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6">
@@ -95,56 +108,66 @@ async function invite() {
> >
</div> </div>
<div v-if="data"> <div v-if="data">
<div class="flex flex-col gap-2"> <VaCard class="my-4">
<p <VaCardTitle>
v-for="(line, i) in tKey(data, 'description').value.split('\n')" {{ data ? tKey(data, 'name') : name }}
:key="i" </VaCardTitle>
> <ClickableImage
{{ line }} v-if="data?.picture"
</p> :src="data?.picture?.url"
</div> class="h-48"
<ClickableImage :title="data ? tKey(data, 'name').value : name"
v-if="data?.picture" />
:src="data?.picture?.url" <VaCardContent>
class="h-48" <div class="mb-4 flex flex-col gap-2">
:title="data ? tKey(data, 'name').value : name" <p
/> v-for="(line, i) in tKey(data, 'description').value.split('\n')"
<p v-if="data.start"> :key="i"
{{ >
t('page.home.start', { {{ line }}
start: d(data.start, fullDate) </p>
}) </div>
}} <p v-if="data.start" class="text-xl">
</p> {{
<p v-if="data.end"> t('page.home.start', {
{{ start: d(data.start, fullDate)
t('page.home.end', { })
start: d(data.end, fullDate) }}
}) </p>
}} <p v-if="data.end" class="text-xl">
</p> {{
<p> t('page.home.end', {
{{ start: d(data.end, fullDate)
t( })
data.ownTeam !== null }}
? 'page.hunt.team_count_joined' </p>
: 'page.hunt.team_count', <p>
data._count.teams {{
) t(
}} data.ownTeam !== null
</p> ? 'page.hunt.team_count_joined'
<p v-if="data.ownTeam"> : 'page.hunt.team_count',
{{ t('page.hunt.your_team') }} data._count.teams
<span class="font-bold">{{ data.ownTeam.name }}</span> )
<VaButton size="small" class="ml-2" @click="invite" }}
>{{ t('page.hunt.invite') }} </p>
<span <div v-if="data.ownTeam" class="mt-4">
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none" <p>
> {{ t('page.hunt.your_team') }}
{{ data.ownTeam.password }}</span <span class="text-xl font-bold">{{ data.ownTeam.name }}</span>
></VaButton </p>
> <VaButton size="small" class="group" @click="invite"
</p> >{{ t('page.hunt.invite') }}
<span
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none group-hover:blur-none"
>
{{ data.ownTeam.password }}</span
></VaButton
>
</div>
</VaCardContent>
</VaCard>
<VaDivider />
<VaCard <VaCard
v-if="data.ownTeam === null && !data.isMember" v-if="data.ownTeam === null && !data.isMember"
color="primary" color="primary"
@@ -167,12 +190,11 @@ async function invite() {
> >
</VaCardActions> </VaCardActions>
</VaCard> </VaCard>
<div v-else-if="!data.isMember" class="flex flex-row gap-2"> <div v-else-if="!data.isMember" class="my-4 flex flex-row gap-2">
<VaSwitch v-model="hideAnswers" icon="image">{{ <VaSwitch v-model="hideAnswers" icon="image">{{
t('page.hunt.hide_answers') t('page.hunt.hide_answers')
}}</VaSwitch> }}</VaSwitch>
</div> </div>
<VaDivider />
<div <div
v-if="data.revealQuests || data.isMember" v-if="data.revealQuests || data.isMember"
class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4" class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4"