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