Formulare im Admin Panel, Event Formular-Fremdschlüssel-Spalte hinzugefügt
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
<script lang="ts" setup>
|
||||
import RitzenbergenLib from "../../ritzenbergenlib.ts";
|
||||
import FormResults from "../FormResults.vue";
|
||||
import { ref } from "vue";
|
||||
import { ref, defineProps } from "vue";
|
||||
import Modal from "../Modal.vue";
|
||||
|
||||
const Formular = RitzenbergenLib.Formular;
|
||||
const Field = RitzenbergenLib.Field;
|
||||
const forms = ref([] as Formular[]);
|
||||
|
||||
const props=defineProps({
|
||||
formid: {
|
||||
type: [Number, null],
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Formular.getForms().then((f) => {
|
||||
forms.value = f;
|
||||
});
|
||||
@@ -23,6 +34,8 @@ function submit($event: Event) {
|
||||
forms.value = Formular.getForms().then((f) => {
|
||||
forms.value = f;
|
||||
});
|
||||
|
||||
values.value={};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,12 +51,12 @@ function openModal(form: Formular){
|
||||
const values=ref({});
|
||||
</script>
|
||||
<template>
|
||||
<Modal v-show="modalOpened" @closemodal="modalOpened=false">
|
||||
<FormResults v-if="openedForm" :form="openedForm"/>
|
||||
<Modal v-if="openedForm && openedForm.ispublic" v-show="modalOpened" @closemodal="modalOpened=false">
|
||||
<FormResults v-if="modalOpened" :form="openedForm"/>
|
||||
</Modal>
|
||||
<section ref="anmeldeformular" id="anmeldeformular">
|
||||
<section class="form5 cid-u6k7q0BfGa">
|
||||
<div class="container" v-for="(form, i) in forms" :key="i">
|
||||
<div class="container" v-for="(form, i) in forms.filter((form)=>form.id==props.formid||props.id==null)" :key="form">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 content-head">
|
||||
<div class="mbr-section-head mb-5">
|
||||
@@ -54,8 +67,8 @@ const values=ref({});
|
||||
</h3>
|
||||
<br />
|
||||
<h5 style="text-align: center">
|
||||
<b @click="openModal(form)" class="fakelink">{{ form.minitext }}
|
||||
</b> <br />
|
||||
<b @click="openModal(form)" class="fakelink" v-if="form.ispublic">{{ form.minitext }}
|
||||
</b> <b v-else>{{ form.minitext }}</b> <br />
|
||||
</h5>
|
||||
<br />
|
||||
</div>
|
||||
@@ -73,7 +86,7 @@ const values=ref({});
|
||||
:data-i="i"
|
||||
@submit.prevent="submit"
|
||||
>
|
||||
<div v-for="(field, j) in form.fields" :key="j">
|
||||
<div v-for="(field, j) in form.fields" :key="field">
|
||||
<label
|
||||
v-if="field.placeholder == null"
|
||||
:for="'field-' + field.id"
|
||||
@@ -82,7 +95,7 @@ const values=ref({});
|
||||
field.displayvalue ?? field.displayname ?? field.name
|
||||
}}:
|
||||
<span v-if="field.type == 'range'"
|
||||
><br />{{ values[field.name] }}</span
|
||||
><br />{{ values[field.id] }}</span
|
||||
>
|
||||
</label>
|
||||
<FormKit
|
||||
@@ -98,7 +111,7 @@ const values=ref({});
|
||||
:checked="field.checked"
|
||||
:title="field.title"
|
||||
:value="field.value"
|
||||
v-model="values[field.name]"
|
||||
v-model="values[field.id]"
|
||||
|
||||
/>
|
||||
<textarea
|
||||
@@ -128,6 +141,10 @@ const values=ref({});
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user