Cleanup admin quest
This commit is contained in:
@@ -93,6 +93,11 @@ const style = computed<[string, string]>(() => {
|
|||||||
const pending = ref(false);
|
const pending = ref(false);
|
||||||
const submitError = ref('');
|
const submitError = ref('');
|
||||||
|
|
||||||
|
async function quickSubmit() {
|
||||||
|
formData.cloned.value.review = '✅';
|
||||||
|
await submit();
|
||||||
|
}
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
pending.value = true;
|
pending.value = true;
|
||||||
submitError.value = '';
|
submitError.value = '';
|
||||||
@@ -214,12 +219,13 @@ async function submit() {
|
|||||||
class="w-full text-center"
|
class="w-full text-center"
|
||||||
>{{ t(submitError) }}</VaAlert
|
>{{ t(submitError) }}</VaAlert
|
||||||
>
|
>
|
||||||
<VaButtonGroup :loading="pending" :disabled="pending">
|
<VaButtonGroup :loading="pending" :disabled="pending" grow>
|
||||||
<VaButton
|
<VaButton
|
||||||
icon="replay"
|
icon="replay"
|
||||||
|
color="danger"
|
||||||
:disabled="!formData.isModified.value"
|
:disabled="!formData.isModified.value"
|
||||||
@click.prevent="formData.sync()"
|
@click.prevent="formData.sync()"
|
||||||
>Reset all values</VaButton
|
>Reset</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
:disabled="formData.isModified.value"
|
:disabled="formData.isModified.value"
|
||||||
@@ -227,10 +233,19 @@ async function submit() {
|
|||||||
>Refresh</VaButton
|
>Refresh</VaButton
|
||||||
>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
|
color="success"
|
||||||
:disabled="!formData.isModified.value"
|
:disabled="!formData.isModified.value"
|
||||||
@click.prevent="submit"
|
@click.prevent="submit"
|
||||||
>Save</VaButton
|
>Save</VaButton
|
||||||
>
|
>
|
||||||
|
<VaButton
|
||||||
|
color="success"
|
||||||
|
:disabled="
|
||||||
|
formData.isModified.value || !!formData.cloned.value.review
|
||||||
|
"
|
||||||
|
@click.prevent="quickSubmit"
|
||||||
|
>✅Save</VaButton
|
||||||
|
>
|
||||||
</VaButtonGroup>
|
</VaButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { useI18nKey } from '~/composables/useI18nKey';
|
|||||||
import { useTitleStore } from '~/stores/title';
|
import { useTitleStore } from '~/stores/title';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['admin']
|
middleware: ['admin'],
|
||||||
|
keepalive: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const app = useNuxtApp();
|
const app = useNuxtApp();
|
||||||
@@ -36,7 +37,7 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>quest admin</h1>
|
<h1 class="my-4 text-3xl">Admin—{{ data?.title_de }}</h1>
|
||||||
<VaButtonGroup>
|
<VaButtonGroup>
|
||||||
<VaButton
|
<VaButton
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
@@ -51,15 +52,21 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
|
|||||||
>Refresh</VaButton
|
>Refresh</VaButton
|
||||||
>
|
>
|
||||||
</VaButtonGroup>
|
</VaButtonGroup>
|
||||||
<div class="grid grid-cols-2 gap-2 p-2 md:flex md:flex-row">
|
<div v-if="data" class="my-2 flex flex-col gap-2 p-4">
|
||||||
|
<p>{{ tKey(data, 'description') }}</p>
|
||||||
|
<p v-if="hasKey(data, 'question')">{{ tKey(data, 'question') }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4 grid grid-cols-2 gap-2 p-2 md:flex md:flex-row">
|
||||||
<VaChip outline>In progress</VaChip>
|
<VaChip outline>In progress</VaChip>
|
||||||
<VaChip color="primary">Reviewable</VaChip>
|
<VaChip color="primary">Reviewable</VaChip>
|
||||||
<VaChip color="danger">Review or Score missing</VaChip>
|
<VaChip color="danger">Review missing</VaChip>
|
||||||
<VaChip color="success">Reviewed</VaChip>
|
<VaChip color="success">Reviewed</VaChip>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="data">
|
<div v-if="data">
|
||||||
<p>{{ data.points }} Points</p>
|
<p class="text-xl">{{ data.points }} Points</p>
|
||||||
<p v-if="data.extraPoints">{{ data.extraPoints }} Extra points</p>
|
<p v-if="data.extraPoints" class="text-xl">
|
||||||
|
{{ data.extraPoints }} Extra points
|
||||||
|
</p>
|
||||||
<p v-if="hasKey(data, 'extraText')">
|
<p v-if="hasKey(data, 'extraText')">
|
||||||
Extra: {{ tKey(data, 'extraText') }}
|
Extra: {{ tKey(data, 'extraText') }}
|
||||||
</p>
|
</p>
|
||||||
@@ -75,7 +82,7 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
|
|||||||
/>
|
/>
|
||||||
</VaAccordion>
|
</VaAccordion>
|
||||||
</div>
|
</div>
|
||||||
<p v-else>No answers yet</p>
|
<p v-else class="mt-4 text-lg">No answers yet</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
import { useForm } from 'vuestic-ui';
|
import { useForm } from 'vuestic-ui';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['guest']
|
middleware: ['guest'],
|
||||||
|
keepalive: false
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { fetch } = useUserSession();
|
const { fetch } = useUserSession();
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { getRandomName } from '#shared/utils/name';
|
|||||||
import { useForm } from 'vuestic-ui';
|
import { useForm } from 'vuestic-ui';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['guest']
|
middleware: ['guest'],
|
||||||
|
keepalive: false
|
||||||
});
|
});
|
||||||
const { fetch } = useUserSession();
|
const { fetch } = useUserSession();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|||||||
Reference in New Issue
Block a user