Start i18n on static texts
This commit is contained in:
+58
-1
@@ -13,7 +13,8 @@
|
|||||||
"register": "Registrieren",
|
"register": "Registrieren",
|
||||||
"register_instead": "Stattdessen registrieren",
|
"register_instead": "Stattdessen registrieren",
|
||||||
"reset": "Zurücksetzen",
|
"reset": "Zurücksetzen",
|
||||||
"showPassword": "Passwort einblenden"
|
"showPassword": "Passwort einblenden",
|
||||||
|
"old_invalid": "Altes Passwort inkorrekt!"
|
||||||
},
|
},
|
||||||
"enums": {
|
"enums": {
|
||||||
"text_type": {
|
"text_type": {
|
||||||
@@ -42,6 +43,17 @@
|
|||||||
"en": "Englisch"
|
"en": "Englisch"
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
"common": {
|
||||||
|
"update_btn": "Updaten",
|
||||||
|
"back_to_hunt": "Zurück zum Hunt",
|
||||||
|
"no_pictures": "Es wurden noch keine Bilder abgeschickt :(",
|
||||||
|
"not_revealed": "Antworten sind noch nicht aufgedeckt, bitte warte bis zum Ende des Hunt!",
|
||||||
|
"admin": "Admin",
|
||||||
|
"refresh": "Aktualisieren",
|
||||||
|
"login_first": "Erst anmelden",
|
||||||
|
"open": "Öffnen",
|
||||||
|
"back_home": "Zurück zur Startseite"
|
||||||
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"click_hunt_below_to_join": "Klick auf einen Hunt um ihm beizutreten!",
|
"click_hunt_below_to_join": "Klick auf einen Hunt um ihm beizutreten!",
|
||||||
"end": "Ende: {start}",
|
"end": "Ende: {start}",
|
||||||
@@ -76,6 +88,51 @@
|
|||||||
"description": "Beschreibung",
|
"description": "Beschreibung",
|
||||||
"score": "Punkte"
|
"score": "Punkte"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"profile": {
|
||||||
|
"old_password": "Altes Passwort",
|
||||||
|
"new_password": "Neues Passwort",
|
||||||
|
"uploaded_pictures": "Hochgeladene Bilder",
|
||||||
|
"no_pictures": "Noch keine Bilder hochgeladen."
|
||||||
|
},
|
||||||
|
"pictures": {
|
||||||
|
"head": "Bilderwand"
|
||||||
|
},
|
||||||
|
"diashow": {
|
||||||
|
"head": "Diashow"
|
||||||
|
},
|
||||||
|
"quest": {
|
||||||
|
"already_finalized": "Antwort ist bereits finalisiert, keine Änderung erlaubt!",
|
||||||
|
"conflict": "Konflikt: Bitte aktualisiere",
|
||||||
|
"extra_points": "Extrapunkte:",
|
||||||
|
"review": "Bewertung",
|
||||||
|
"score": "Punkte:",
|
||||||
|
"reviewed_by": "von {name} am {date}",
|
||||||
|
"last_update": "Letztes Update: {date} von {name}",
|
||||||
|
"submission": "Einreichung",
|
||||||
|
"your_answer": "Deine Antwort",
|
||||||
|
"required_answer": "Erforderliche Antwort",
|
||||||
|
"finalize": "Antwort finalisieren",
|
||||||
|
"already_submitted": "Deine Antwort wurde bereits übermittelt!",
|
||||||
|
"finalize_explain": "Dies gibt den Admins die Möglichkeit deine Antwort zu bewerten und dir Punkte zu geben. Du kannst deine Antwort anschließend nicht mehr ändern!"
|
||||||
|
},
|
||||||
|
"hunt": {
|
||||||
|
"total_points": "Punktestand: {score}",
|
||||||
|
"showcase": "Showcase",
|
||||||
|
"diashow": "Diashow",
|
||||||
|
"all_pictures": "Bilderwand",
|
||||||
|
"teams": "Teams",
|
||||||
|
"team_count": "Keine Team beigetreten, so wie du! | Ein Team ist beigetreten, du noch nicht! | {count} Teams sind beigetreten, du noch nicht!",
|
||||||
|
"team_count_joined": "Keine Team beigetreten, so wie du! | Ein Team ist beigetreten, du auch! | {count} Teams sind beigetreten, du auch!",
|
||||||
|
"your_team": "Dein Team:",
|
||||||
|
"invite": "Einladen:",
|
||||||
|
"join_this_hunt": "Trete diesem Hunt bei!",
|
||||||
|
"login_to_join": "Um diesem Hunt beizutreten suche oder erstelle ein Team:",
|
||||||
|
"hide_answers": "Antworten verstecken",
|
||||||
|
"no_picture_uploaded": "Kein Bild hochgeladen",
|
||||||
|
"admin_unreviewed": "Admin ({count} unbewertet)",
|
||||||
|
"quest_not_revealed": "Quests wurden noch nicht aufgedeckt!",
|
||||||
|
"quest_soon_reveal": "Bald werden alle {count} Quests aufgedeckt!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validation": {
|
"validation": {
|
||||||
|
|||||||
+58
-1
@@ -13,7 +13,8 @@
|
|||||||
"register": "Register",
|
"register": "Register",
|
||||||
"register_instead": "Register instead",
|
"register_instead": "Register instead",
|
||||||
"reset": "Reset",
|
"reset": "Reset",
|
||||||
"showPassword": "Show password"
|
"showPassword": "Show password",
|
||||||
|
"old_invalid": "Old password incorrect!"
|
||||||
},
|
},
|
||||||
"enums": {
|
"enums": {
|
||||||
"text_type": {
|
"text_type": {
|
||||||
@@ -42,6 +43,17 @@
|
|||||||
"en": "English"
|
"en": "English"
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
"common": {
|
||||||
|
"update_btn": "Update",
|
||||||
|
"back_to_hunt": "Back to Hunt",
|
||||||
|
"no_pictures": "No pictures has been submitted yet :(",
|
||||||
|
"not_revealed": "Answers are not revealed yet, please wait until the end!",
|
||||||
|
"admin": "Admin",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"login_first": "Login first",
|
||||||
|
"open": "Open",
|
||||||
|
"back_home": "Back home"
|
||||||
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"click_hunt_below_to_join": "Click on a hunt below and join them!",
|
"click_hunt_below_to_join": "Click on a hunt below and join them!",
|
||||||
"end": "End: {start}",
|
"end": "End: {start}",
|
||||||
@@ -76,6 +88,51 @@
|
|||||||
"description": "Description",
|
"description": "Description",
|
||||||
"score": "Score"
|
"score": "Score"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"profile": {
|
||||||
|
"old_password": "Old password",
|
||||||
|
"new_password": "New password",
|
||||||
|
"uploaded_pictures": "Uploaded pictures",
|
||||||
|
"no_pictures": "No pictures uploaded yet."
|
||||||
|
},
|
||||||
|
"pictures": {
|
||||||
|
"head": "Picture wall"
|
||||||
|
},
|
||||||
|
"diashow": {
|
||||||
|
"head": "Diashow"
|
||||||
|
},
|
||||||
|
"quest": {
|
||||||
|
"already_finalized": "Answer is already finalized, no update allowed!",
|
||||||
|
"conflict": "Conflict: Please refresh",
|
||||||
|
"extra_points": "Extra points:",
|
||||||
|
"review": "Review",
|
||||||
|
"score": "Score:",
|
||||||
|
"reviewed_by": "by {name} at {date}",
|
||||||
|
"last_update": "Last update: {date} by {name}",
|
||||||
|
"submission": "Submission",
|
||||||
|
"your_answer": "Your answer",
|
||||||
|
"required_answer": "Required Answer",
|
||||||
|
"finalize": "Finalize answer",
|
||||||
|
"already_submitted": "Your final answer has already been submitted!",
|
||||||
|
"finalize_explain": "This allows the admins to review your answer and give you points. You cannot change your answer afterwards!"
|
||||||
|
},
|
||||||
|
"hunt": {
|
||||||
|
"total_points": "Total points: {score}",
|
||||||
|
"showcase": "Showcase",
|
||||||
|
"diashow": "Diashow",
|
||||||
|
"all_pictures": "All pictures",
|
||||||
|
"teams": "Teams",
|
||||||
|
"team_count": "No teams joined, just like you! | One team joined, unlike you! | {count} teams joined, unlike you!",
|
||||||
|
"team_count_joined": "No teams joined, just like you! | One team joined, just like you! | {count} teams joined, just like you!",
|
||||||
|
"your_team": "Your team:",
|
||||||
|
"invite": "Invite:",
|
||||||
|
"join_this_hunt": "Join this hunt!",
|
||||||
|
"login_to_join": "To join this hunt you need to join or create a team:",
|
||||||
|
"hide_answers": "Hide answers",
|
||||||
|
"no_picture_uploaded": "No picture uploaded",
|
||||||
|
"admin_unreviewed": "Admin ({count} unreviewed)",
|
||||||
|
"quest_not_revealed": "Quests not revealed yet!",
|
||||||
|
"quest_soon_reveal": "Soon all {count} quests will be revealed!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validation": {
|
"validation": {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
|
|||||||
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton icon="replay" color="success" @click="refresh"
|
<VaButton icon="replay" color="success" @click="refresh"
|
||||||
>Refresh</VaButton
|
>Refresh</VaButton
|
||||||
|
|||||||
@@ -85,14 +85,14 @@ async function submit() {
|
|||||||
newImage.value = undefined;
|
newImage.value = undefined;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error && 'statusCode' in e && e.statusCode === 418) {
|
if (e instanceof Error && 'statusCode' in e && e.statusCode === 418) {
|
||||||
submitError.value = 'Answer is already finalized, no update allowed!';
|
submitError.value = t('page.quest.already_finalized');
|
||||||
await refresh();
|
await refresh();
|
||||||
} else if (
|
} else if (
|
||||||
e instanceof Error &&
|
e instanceof Error &&
|
||||||
'statusCode' in e &&
|
'statusCode' in e &&
|
||||||
e.statusCode === 409
|
e.statusCode === 409
|
||||||
) {
|
) {
|
||||||
submitError.value = 'Conflict: Please refresh';
|
submitError.value = t('page.quest.conflict');
|
||||||
} else {
|
} else {
|
||||||
submitError.value = parseError(e);
|
submitError.value = parseError(e);
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
icon="refresh"
|
icon="refresh"
|
||||||
@@ -134,7 +134,7 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
`/hunt/${data?.hunt ? tSluggy(data.hunt).value : sluggy(huntSlug!)}/${data ? tSluggy(data).value : sluggy(questSlug!)}}/admin`
|
`/hunt/${data?.hunt ? tSluggy(data.hunt).value : sluggy(huntSlug!)}/${data ? tSluggy(data).value : sluggy(questSlug!)}}/admin`
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>Admin</VaButton
|
>{{ t('pages.common.admin') }}</VaButton
|
||||||
></VaButtonGroup
|
></VaButtonGroup
|
||||||
>
|
>
|
||||||
<div v-if="data">
|
<div v-if="data">
|
||||||
@@ -164,21 +164,27 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
🖋: {{ t(`enums.text_type.${data.textType}`) }}
|
🖋: {{ t(`enums.text_type.${data.textType}`) }}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="hasKey(data, 'extraText')">
|
<p v-if="hasKey(data, 'extraText')">
|
||||||
<span class="uppercase">Extra points:</span>
|
<span class="uppercase">{{
|
||||||
|
t('page.quest.extra_points')
|
||||||
|
}}</span>
|
||||||
{{ tKey(data, 'extraText') }}
|
{{ tKey(data, 'extraText') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
<VaCard v-if="data.answer?.review" color="info">
|
<VaCard v-if="data.answer?.review" color="info">
|
||||||
<VaCardTitle>Review</VaCardTitle>
|
<VaCardTitle>{{ t('page.quest.review') }}</VaCardTitle>
|
||||||
<VaCardContent>
|
<VaCardContent>
|
||||||
<p v-if="data.answer.review?.score" class="mb-2">
|
<p v-if="data.answer.review?.score" class="mb-2">
|
||||||
Score:
|
{{ t('page.quest.score') }}
|
||||||
<VaChip color="success">{{ data.answer.review.score }}</VaChip>
|
<VaChip color="success">{{ data.answer.review.score }}</VaChip>
|
||||||
<span v-if="data.answer.review.reviewer" class="text-sm">
|
<span v-if="data.answer.review.reviewer" class="text-sm">
|
||||||
by {{ data.answer.review.reviewer.name }} at
|
{{
|
||||||
{{ d(data.answer.review.updatedAt, fullDate) }}</span
|
t('page.quest.reviewed_by', {
|
||||||
|
name: data.answer.review.reviewer.name,
|
||||||
|
date: d(data.answer.review.updatedAt, fullDate)
|
||||||
|
})
|
||||||
|
}}</span
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<div
|
<div
|
||||||
@@ -200,7 +206,7 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
stripe
|
stripe
|
||||||
:stripe-color="data.answer?.final ? 'success' : 'primary'"
|
:stripe-color="data.answer?.final ? 'success' : 'primary'"
|
||||||
>
|
>
|
||||||
<VaCardTitle>Submission</VaCardTitle>
|
<VaCardTitle>{{ t('page.quest.submission') }}</VaCardTitle>
|
||||||
<VaCardContent>
|
<VaCardContent>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<VaInput
|
<VaInput
|
||||||
@@ -208,7 +214,7 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
v-model="answer"
|
v-model="answer"
|
||||||
:label="tKey(data, 'question').value"
|
:label="tKey(data, 'question').value"
|
||||||
:disabled="uploading || data.answer?.final"
|
:disabled="uploading || data.answer?.final"
|
||||||
placeholder="Your answer"
|
:placeholder="t('page.quest.your_answer')"
|
||||||
:required-mark="data.textRequired"
|
:required-mark="data.textRequired"
|
||||||
:clearable="!!data.answer?.text"
|
:clearable="!!data.answer?.text"
|
||||||
:clear-value="data.answer?.text || ''"
|
:clear-value="data.answer?.text || ''"
|
||||||
@@ -216,7 +222,7 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
:type="textType[data.textType]"
|
:type="textType[data.textType]"
|
||||||
:messages="[
|
:messages="[
|
||||||
t(`enums.text_type.${data.textType}`),
|
t(`enums.text_type.${data.textType}`),
|
||||||
data.textRequired ? 'Required Answer' : ''
|
data.textRequired ? t('page.quest.required_answer') : ''
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<template v-if="data.textUnit" #appendInner>
|
<template v-if="data.textUnit" #appendInner>
|
||||||
@@ -247,15 +253,18 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
file-types="jpg,png,jpeg"
|
file-types="jpg,png,jpeg"
|
||||||
/>
|
/>
|
||||||
<p v-if="data.answer?.updatedAt">
|
<p v-if="data.answer?.updatedAt">
|
||||||
Last update:
|
{{
|
||||||
{{ d(data.answer.updatedAt, fullDate) }}
|
t('page.quest.last_update', {
|
||||||
by {{ data.answer.member.name }}
|
date: d(data.answer.updatedAt, fullDate),
|
||||||
|
name: data.answer.member.name
|
||||||
|
})
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<VaCheckbox
|
<VaCheckbox
|
||||||
v-model="final"
|
v-model="final"
|
||||||
:disabled="data.answer?.final"
|
:disabled="data.answer?.final"
|
||||||
label="Finalize answer"
|
:label="t('page.quest.finalize')"
|
||||||
messages="This allows the admins to review your answer and give you points. You cannot change your answer afterwards!"
|
:messages="t('page.quest.already_finalized')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VaAlert
|
<VaAlert
|
||||||
@@ -275,10 +284,10 @@ const createImageURL = (file: File) => URL.createObjectURL(file);
|
|||||||
"
|
"
|
||||||
:loading="uploading"
|
:loading="uploading"
|
||||||
@click="submit"
|
@click="submit"
|
||||||
>Update</VaButton
|
>{{ t('page.common.update_btn') }}</VaButton
|
||||||
>
|
>
|
||||||
<p v-else class="font-bold">
|
<p v-else class="font-bold">
|
||||||
Your final answer has already been submitted!
|
{{ t('page.quest.already_submitted') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const { data, refresh, error } = await useFetch(`/api/hunt/${id}/diashow`, {
|
|||||||
useHead({
|
useHead({
|
||||||
title: t('layouts.two_title', {
|
title: t('layouts.two_title', {
|
||||||
title: data.value?.name || name,
|
title: data.value?.name || name,
|
||||||
subtitle: 'Diashow'
|
subtitle: t('pages.diashow.head')
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -92,28 +92,29 @@ titleStore.title = data.value?.name;
|
|||||||
v-else-if="error"
|
v-else-if="error"
|
||||||
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
||||||
>
|
>
|
||||||
<VaAlert color="danger" class="w-[90%]"
|
<VaAlert color="danger" class="w-[90%]">{{
|
||||||
>Answers are not revealed yet, please wait until the end!</VaAlert
|
t('pages.common.not_revealed')
|
||||||
>
|
}}</VaAlert>
|
||||||
<VaAlert v-if="error.statusCode !== 403" color="danger" class="w-[90%]">{{
|
<VaAlert v-if="error.statusCode !== 403" color="danger" class="w-[90%]">{{
|
||||||
error
|
error
|
||||||
}}</VaAlert
|
}}</VaAlert
|
||||||
><VaButton
|
><VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
||||||
>
|
>
|
||||||
<VaAlert color="danger" class="w-[90%]"
|
<VaAlert color="danger" class="w-[90%]">{{
|
||||||
>Answers are not revealed yet, please wait until the end!</VaAlert
|
t('pages.common.not_revealed')
|
||||||
|
}}</VaAlert
|
||||||
><VaButton
|
><VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ async function invite() {
|
|||||||
<h1 class="text-2xl">
|
<h1 class="text-2xl">
|
||||||
{{ 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">{{
|
||||||
>Total points: {{ data!!.totalScore }}</VaChip
|
t('page.hunt.total_points', data!!.totalScore)
|
||||||
>
|
}}</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">
|
||||||
<VaButton
|
<VaButton
|
||||||
@@ -56,7 +56,7 @@ async function invite() {
|
|||||||
:disabled="pending"
|
:disabled="pending"
|
||||||
title="Refresh"
|
title="Refresh"
|
||||||
@click="refresh"
|
@click="refresh"
|
||||||
>Refresh</VaButton
|
>{{ t('page.common.refresh') }}</VaButton
|
||||||
>
|
>
|
||||||
|
|
||||||
<VaButton
|
<VaButton
|
||||||
@@ -64,34 +64,34 @@ async function invite() {
|
|||||||
color="success"
|
color="success"
|
||||||
icon="leaderboard"
|
icon="leaderboard"
|
||||||
:to="$localePath(`/hunt/${tSluggy(data).value}/showcase`)"
|
:to="$localePath(`/hunt/${tSluggy(data).value}/showcase`)"
|
||||||
>Showcase</VaButton
|
>{{ t('page.hunt.showcase') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
||||||
color="success"
|
color="success"
|
||||||
icon="collections"
|
icon="collections"
|
||||||
:to="$localePath(`/hunt/${tSluggy(data).value}/diashow`)"
|
:to="$localePath(`/hunt/${tSluggy(data).value}/diashow`)"
|
||||||
>Diashow</VaButton
|
>{{ t('page.hunt.diashow') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
||||||
color="success"
|
color="success"
|
||||||
icon="auto_awesome_mosaic"
|
icon="auto_awesome_mosaic"
|
||||||
:to="$localePath(`/hunt/${tSluggy(data).value}/pictures`)"
|
:to="$localePath(`/hunt/${tSluggy(data).value}/pictures`)"
|
||||||
>All pictures</VaButton
|
>{{ t('page.hunt.all_pictures') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
v-if="data?.isMember"
|
v-if="data?.isMember"
|
||||||
color="danger"
|
color="danger"
|
||||||
icon="edit"
|
icon="edit"
|
||||||
:to="$localePath(`/hunt/${tSluggy(data).value}/admin`)"
|
:to="$localePath(`/hunt/${tSluggy(data).value}/admin`)"
|
||||||
>Admin</VaButton
|
>{{ t('page.common.admin') }}</VaButton
|
||||||
><VaButton
|
><VaButton
|
||||||
v-if="data?.isMember"
|
v-if="data?.isMember"
|
||||||
color="danger"
|
color="danger"
|
||||||
icon="groups"
|
icon="groups"
|
||||||
:to="$localePath(`/hunt/${tSluggy(data).value}/teams`)"
|
:to="$localePath(`/hunt/${tSluggy(data).value}/teams`)"
|
||||||
>Teams</VaButton
|
>{{ t('page.hunt.teams') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="data">
|
<div v-if="data">
|
||||||
@@ -110,22 +110,34 @@ async function invite() {
|
|||||||
:title="data ? tKey(data, 'name').value : name"
|
:title="data ? tKey(data, 'name').value : name"
|
||||||
/>
|
/>
|
||||||
<p v-if="data.start">
|
<p v-if="data.start">
|
||||||
Start:
|
{{
|
||||||
{{ d(data.start, fullDate) }}
|
t('page.home.start', {
|
||||||
|
start: d(data.start, fullDate)
|
||||||
|
})
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="data.end">
|
<p v-if="data.end">
|
||||||
End:
|
{{
|
||||||
{{ d(data.end, fullDate) }}
|
t('page.home.end', {
|
||||||
|
start: d(data.end, fullDate)
|
||||||
|
})
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{{ data._count.teams }} teams joined{{
|
{{
|
||||||
data.ownTeam !== null ? ', just like you' : ', unlike you'
|
t(
|
||||||
}}!
|
data.ownTeam !== null
|
||||||
|
? 'page.hunt.team_count_joined'
|
||||||
|
: 'page.hunt.team_count',
|
||||||
|
data._count.teams
|
||||||
|
)
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="data.ownTeam">
|
<p v-if="data.ownTeam">
|
||||||
Your team: <span class="font-bold">{{ data.ownTeam.name }}</span>
|
{{ t('page.hunt.your_team') }}
|
||||||
|
<span class="font-bold">{{ data.ownTeam.name }}</span>
|
||||||
<VaButton size="small" class="ml-2" @click="invite"
|
<VaButton size="small" class="ml-2" @click="invite"
|
||||||
>Invite:
|
>{{ t('page.hunt.invite') }}
|
||||||
<span
|
<span
|
||||||
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none"
|
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none"
|
||||||
>
|
>
|
||||||
@@ -138,10 +150,10 @@ async function invite() {
|
|||||||
color="primary"
|
color="primary"
|
||||||
class="mb-16 mt-8"
|
class="mb-16 mt-8"
|
||||||
>
|
>
|
||||||
<VaCardTitle>Join this hunt!</VaCardTitle>
|
<VaCardTitle>{{ t('page.hunt.join_this_hunt') }}</VaCardTitle>
|
||||||
<VaCardContent class="text-2xl"
|
<VaCardContent class="text-2xl">{{
|
||||||
>To join this hunt you need to join or create a team:</VaCardContent
|
t('page.hunt.login_to_join')
|
||||||
>
|
}}</VaCardContent>
|
||||||
<VaCardActions v-if="data.loggedIn">
|
<VaCardActions v-if="data.loggedIn">
|
||||||
<TeamJoinModal :hunt-id="data.id" @update="refresh" />
|
<TeamJoinModal :hunt-id="data.id" @update="refresh" />
|
||||||
<TeamAddModal :hunt-id="data.id" @update="refresh" />
|
<TeamAddModal :hunt-id="data.id" @update="refresh" />
|
||||||
@@ -151,12 +163,14 @@ async function invite() {
|
|||||||
color="info"
|
color="info"
|
||||||
icon="login"
|
icon="login"
|
||||||
:to="$localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
|
:to="$localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
|
||||||
>Login first</VaButton
|
>{{ t('page.common.login_first') }}</VaButton
|
||||||
>
|
>
|
||||||
</VaCardActions>
|
</VaCardActions>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
<div v-else-if="!data.isMember" class="flex flex-row gap-2">
|
<div v-else-if="!data.isMember" class="flex flex-row gap-2">
|
||||||
<VaSwitch v-model="hideAnswers" icon="image">Hide answers</VaSwitch>
|
<VaSwitch v-model="hideAnswers" icon="image">{{
|
||||||
|
t('page.hunt.hide_answers')
|
||||||
|
}}</VaSwitch>
|
||||||
</div>
|
</div>
|
||||||
<VaDivider />
|
<VaDivider />
|
||||||
<div
|
<div
|
||||||
@@ -180,7 +194,7 @@ async function invite() {
|
|||||||
<VaImage
|
<VaImage
|
||||||
v-if="!hideAnswers"
|
v-if="!hideAnswers"
|
||||||
:src="quest?.answer?.picture?.url ?? ''"
|
:src="quest?.answer?.picture?.url ?? ''"
|
||||||
fallback-text="No picture uploaded"
|
:fallback-text="t('page.hunt.no_picture_uploaded')"
|
||||||
class="h-32"
|
class="h-32"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
lazy
|
lazy
|
||||||
@@ -205,7 +219,7 @@ async function invite() {
|
|||||||
color="primary"
|
color="primary"
|
||||||
icon="rate_review"
|
icon="rate_review"
|
||||||
class="flex-grow"
|
class="flex-grow"
|
||||||
>Open</VaButton
|
>{{ t('page.common.open') }}</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
v-if="data.isMember"
|
v-if="data.isMember"
|
||||||
@@ -216,23 +230,26 @@ async function invite() {
|
|||||||
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}/admin`
|
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}/admin`
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>Admin ({{ quest.unreviewed || 0 }} unreviewed)</VaButton
|
>{{
|
||||||
|
t('page.hunt.admin_unreviewed', quest.unreviewed || 0)
|
||||||
|
}}</VaButton
|
||||||
>
|
>
|
||||||
</VaCardActions>
|
</VaCardActions>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
</div>
|
</div>
|
||||||
<VaCard v-else color="warning" class="mt-4"
|
<VaCard v-else color="warning" class="mt-4"
|
||||||
><VaCardTitle>Quests not revealed yet!</VaCardTitle>
|
><VaCardTitle>{{ t('page.hunt.quest_not_revealed') }}</VaCardTitle>
|
||||||
<VaCardContent
|
<VaCardContent>{{
|
||||||
>Soon all {{ data._count.quests }} quests will be
|
t('page.hunt.quest_soon_reveal', data._count.quests)
|
||||||
revealed!</VaCardContent
|
}}</VaCardContent>
|
||||||
>
|
|
||||||
</VaCard>
|
</VaCard>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="error">
|
<div v-if="error">
|
||||||
<h1 class="mt-8 text-3xl">{{ t(parseError(error)) }}</h1>
|
<h1 class="mt-8 text-3xl">{{ t(parseError(error)) }}</h1>
|
||||||
<VaButton icon="arrow_back" :to="$localePath(`/`)">Back home</VaButton>
|
<VaButton icon="arrow_back" :to="$localePath(`/`)">{{
|
||||||
|
t('page.common.back_home')
|
||||||
|
}}</VaButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const { data, refresh, error } = await useFetch(`/api/hunt/${id}/diashow`, {
|
|||||||
useHead({
|
useHead({
|
||||||
title: t('layouts.two_title', {
|
title: t('layouts.two_title', {
|
||||||
title: hasKey(data.value, 'name') ? tKey(data.value!, 'name').value : name,
|
title: hasKey(data.value, 'name') ? tKey(data.value!, 'name').value : name,
|
||||||
subtitle: 'Diashow'
|
subtitle: t('pages.pictures.head')
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -95,35 +95,36 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
|
|||||||
v-if="data.count <= 0"
|
v-if="data.count <= 0"
|
||||||
color="warning"
|
color="warning"
|
||||||
class="sm:col-span-2 md:col-span-3 lg:col-span-4"
|
class="sm:col-span-2 md:col-span-3 lg:col-span-4"
|
||||||
>No pictures has been submitted yet :(</VaAlert
|
>{{ t('pages.common.no_pictures') }}</VaAlert
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="error"
|
v-else-if="error"
|
||||||
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
||||||
>
|
>
|
||||||
<VaAlert color="danger" class="w-[90%]"
|
<VaAlert color="danger" class="w-[90%]">{{
|
||||||
>Answers are not revealed yet, please wait until the end!</VaAlert
|
t('pages.common.not_revealed')
|
||||||
>
|
}}</VaAlert>
|
||||||
<VaAlert v-if="error.statusCode !== 403" color="danger" class="w-[90%]">{{
|
<VaAlert v-if="error.statusCode !== 403" color="danger" class="w-[90%]">{{
|
||||||
error
|
error
|
||||||
}}</VaAlert
|
}}</VaAlert
|
||||||
><VaButton
|
><VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
class="flex h-full w-full flex-col items-center justify-center text-center text-2xl"
|
||||||
>
|
>
|
||||||
<VaAlert color="danger" class="w-[90%]"
|
<VaAlert color="danger" class="w-[90%]">{{
|
||||||
>Answers are not revealed yet, please wait until the end!</VaAlert
|
t('pages.common.not_revealed')
|
||||||
|
}}</VaAlert
|
||||||
><VaButton
|
><VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ const columns = leaderboardColumns.map((c) =>
|
|||||||
><VaButton
|
><VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||||
>Back to Hunt</VaButton
|
>{{ t('pages.common.back_to_hunt') }}</VaButton
|
||||||
>
|
>
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
+10
-12
@@ -43,8 +43,7 @@ async function submitProfile() {
|
|||||||
await fetch();
|
await fetch();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error && 'statusCode' in e && e.statusCode === 409) {
|
if (e instanceof Error && 'statusCode' in e && e.statusCode === 409) {
|
||||||
// ToDo: i18n
|
profileError.value = t('auth.conflict');
|
||||||
profileError.value = 'Email already exists!';
|
|
||||||
} else {
|
} else {
|
||||||
profileError.value = parseError(e);
|
profileError.value = parseError(e);
|
||||||
}
|
}
|
||||||
@@ -72,8 +71,7 @@ async function submitPassword() {
|
|||||||
password.old = '';
|
password.old = '';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error && 'statusCode' in e && e.statusCode === 404) {
|
if (e instanceof Error && 'statusCode' in e && e.statusCode === 404) {
|
||||||
// ToDo: i18n
|
passwordError.value = t('auth.old_invalid');
|
||||||
passwordError.value = 'Old password incorrect!';
|
|
||||||
} else {
|
} else {
|
||||||
passwordError.value = parseError(e);
|
passwordError.value = parseError(e);
|
||||||
}
|
}
|
||||||
@@ -91,7 +89,7 @@ async function submitPassword() {
|
|||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<VaInput
|
<VaInput
|
||||||
v-model="form.name"
|
v-model="form.name"
|
||||||
label="Name"
|
:label="t('auth.name')"
|
||||||
clearable
|
clearable
|
||||||
:clear-value="data.name"
|
:clear-value="data.name"
|
||||||
clearable-icon="replay"
|
clearable-icon="replay"
|
||||||
@@ -107,7 +105,7 @@ async function submitPassword() {
|
|||||||
/>
|
/>
|
||||||
<VaInput
|
<VaInput
|
||||||
v-model="form.email"
|
v-model="form.email"
|
||||||
label="Email"
|
:label="t('auth.email')"
|
||||||
type="email"
|
type="email"
|
||||||
clearable
|
clearable
|
||||||
:clear-value="data.email"
|
:clear-value="data.email"
|
||||||
@@ -129,7 +127,7 @@ async function submitPassword() {
|
|||||||
color="success"
|
color="success"
|
||||||
:disabled="!changed || pending || uploading"
|
:disabled="!changed || pending || uploading"
|
||||||
@click="submitProfile"
|
@click="submitProfile"
|
||||||
>Update</VaButton
|
>{{ t('page.common.update_btn') }}</VaButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
@@ -143,8 +141,8 @@ async function submitPassword() {
|
|||||||
v-model="password.old"
|
v-model="password.old"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:type="isPasswordVisible.value ? 'text' : 'password'"
|
:type="isPasswordVisible.value ? 'text' : 'password'"
|
||||||
label="Old password"
|
:label="t('pages.profile.old_password')"
|
||||||
:placeholder="t('auth.password')"
|
:placeholder="t('pages.profile.old_password')"
|
||||||
autocomplete="current-password"
|
autocomplete="current-password"
|
||||||
:minlength="8"
|
:minlength="8"
|
||||||
required
|
required
|
||||||
@@ -181,7 +179,7 @@ async function submitPassword() {
|
|||||||
v-model="password.password"
|
v-model="password.password"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:type="isPasswordVisible.value ? 'text' : 'password'"
|
:type="isPasswordVisible.value ? 'text' : 'password'"
|
||||||
label="New password"
|
:label="t('pages.profile.new_password')"
|
||||||
:placeholder="t('auth.password')"
|
:placeholder="t('auth.password')"
|
||||||
autocomplete="current-password"
|
autocomplete="current-password"
|
||||||
:minlength="8"
|
:minlength="8"
|
||||||
@@ -236,7 +234,7 @@ async function submitPassword() {
|
|||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
<VaCard stripe stripe-color="primary">
|
<VaCard stripe stripe-color="primary">
|
||||||
<VaCardTitle>Uploaded pictures</VaCardTitle>
|
<VaCardTitle>{{ t('pages.profile.uploaded_pictures') }}</VaCardTitle>
|
||||||
<VaCardContent v-if="data && data.uploadedFiles.length > 0">
|
<VaCardContent v-if="data && data.uploadedFiles.length > 0">
|
||||||
<VaCarousel
|
<VaCarousel
|
||||||
stateful
|
stateful
|
||||||
@@ -266,7 +264,7 @@ async function submitPassword() {
|
|||||||
>
|
>
|
||||||
</VaCarousel>
|
</VaCarousel>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
<VaCardContent v-else> No pictures uploaded yet. </VaCardContent>
|
<VaCardContent v-else>{{ t('pages.profile.no_pictures') }}</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user