fix some stuff
Build / Build-image (push) Successful in 1m9s

This commit is contained in:
2026-08-21 10:47:26 +02:00
parent 853498e9ac
commit 73b0f6527a
14 changed files with 312 additions and 40 deletions
+42 -32
View File
@@ -1,35 +1,40 @@
<script setup lang="ts">
import Modal from '../components/Modal.vue';
</script>
<template>
<h1>TLA suggestion form</h1>
<UCard class="w-140 align-center">
<UForm @submit="onSubmit" class="space-y-4" action="/api/suggestion" method="post">
<UFormField class="form-field" label="Acronym" required>
<UInput v-model="form.acronym" class="w-80" placeholder="Enter your TLA" name="tla"></UInput>
</UFormField>
<UFormField label="Motto" required>
<UInput class="w-80" v-model="form.hint" placeholder="Enter the motto for your TLA" name="hint"></UInput>
</UFormField>
<UFormField label="Contex" required>
<UTextarea class="w-80" v-model="form.context" name="context" rows=5 placeholder="Provide context for your TLA. This will be displayed upon completing the riddle of the day, either by guessing it correctly, or by running out of guesses."></UTextarea>
</UFormField>
<UFormField required>
<URadioGroup orientation="horizontal" v-model="form.language" name="language" variant="table" size="xs" default-value="en" :items="['en', 'hu']" />
</UFormField>
<UFormField class="form-field" label="Submitter (your name)">
<UInput v-model="form.submitter" class="w-80" placeholder="Anonymus" name="submitter"></UInput>
</UFormField>
<UButton type="submit">
Submit suggestion
</UButton>
</UForm>
<br>
Disclaimer: I'm going through these manually, approving them or even changing the context or motto for them, if I feel it's necessary. I don't guarantee, that your suggestion will be approved and even if it is, it may not be next days TLA.
</UCard>
<UCard class="align-center">
<UForm @submit="onSubmit" class="space-y-4" action="/api/suggestion" method="post">
<UFormField class="form-field" label="Acronym" required>
<UInput v-model="form.acronym" class="w-80" placeholder="Enter your TLA" name="tla"></UInput>
</UFormField>
<UFormField label="Motto" required>
<UInput class="w-80" v-model="form.hint" placeholder="Enter the motto for your TLA" name="hint"></UInput>
</UFormField>
<UFormField label="Contex" required>
<UTextarea class="w-80" v-model="form.context" name="context" rows=5 placeholder="Provide context for your TLA. This will be displayed upon completing the riddle of the day, either by guessing it correctly, or by running out of guesses."></UTextarea>
</UFormField>
<UFormField required>
<URadioGroup orientation="horizontal" v-model="form.language" name="language" variant="table" size="xs" default-value="en" :items="['en', 'hu']" />
</UFormField>
<UFormField class="form-field" label="Submitter (your name)">
<UInput v-model="form.submitter" class="w-80" placeholder="Anonymus" name="submitter"></UInput>
</UFormField>
<UButton type="submit">
Submit suggestion
</UButton>
</UForm>
<br>
Disclaimer: I'm going through these manually, approving them or even changing the context or motto for them, if I feel it's necessary. I don't guarantee, that your suggestion will be approved and even if it is, it may not be next days TLA.
</UCard>
<Modal v-model:open="submited">
<b>Your suggestion has been submitted!</b><br>
If you wish, you can submit adnother TLA by exiting this alert. <br><br>
<UButton to="/">Main page</UButton>
<UButton to="/">Main page</UButton>
</Modal>
</template>
@@ -46,6 +51,7 @@
<script lang="ts">
import axios from 'axios';
export default {
data() {
return {
@@ -62,13 +68,17 @@ import axios from 'axios';
},
methods: {
onSubmit() {
axios.post('/api/suggestion/en', this.form);
this.form.acronym = '';
this.form.hint = '';
this.form.context = '';
this.form.submitter = '';
this.form.language = 'en';
this.submited = true;
axios.post('/api/suggestion/en', this.form).then( response => {
if (response.status == 200)
{
this.form.acronym = '';
this.form.hint = '';
this.form.context = '';
this.form.submitter = '';
this.form.language = 'en';
this.submited = true;
}
});
}
}
}