This commit is contained in:
philipp lang 2024-07-03 16:37:58 +02:00
parent 99a28f44dd
commit 7f9be4262c
28 changed files with 129 additions and 139 deletions

View File

@ -36,12 +36,12 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref, defineProps} from 'vue'; import { ref, defineProps } from 'vue';
import {indexProps, useIndex} from '../../composables/useIndex.js'; import { indexProps, useIndex } from '../../composables/useIndex.js';
const props = defineProps(indexProps); const props = defineProps(indexProps);
const {router, data, meta} = useIndex(props.data, 'activity'); const { router, data, meta } = useIndex(props.data, 'activity');
const deleting = ref(null); const deleting = ref(null);
function remove() { function remove() {

View File

@ -31,12 +31,12 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref, computed, inject} from 'vue'; import { ref, computed, inject } from 'vue';
import useSearch from '../../composables/useSearch.js'; import useSearch from '../../composables/useSearch.js';
const axios = inject('axios'); const axios = inject('axios');
const {search} = useSearch(); const { search } = useSearch();
const props = defineProps({ const props = defineProps({
data: {}, data: {},

View File

@ -75,11 +75,11 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {useApiIndex} from '../../composables/useApiIndex.js'; import { useApiIndex } from '../../composables/useApiIndex.js';
import SettingLayout from '../setting/Layout.vue'; import SettingLayout from '../setting/Layout.vue';
const {meta, data, reload, create, edit, cancel, single, submit} = useApiIndex('/api/fileshare', 'fileshare'); const { meta, data, reload, create, edit, cancel, single, submit } = useApiIndex('/api/fileshare', 'fileshare');
function getType(type) { function getType(type) {
if (!type) { if (!type) {

View File

@ -55,8 +55,8 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
import {ref, inject, computed} from 'vue'; import { ref, inject, computed } from 'vue';
const axios = inject('axios'); const axios = inject('axios');
const emit = defineEmits(['save']); const emit = defineEmits(['save']);
@ -70,15 +70,15 @@ const props = defineProps({
}); });
const comparatorOptions = ref([ const comparatorOptions = ref([
{id: 'isEqual', name: 'ist gleich', defaultValue: {DropdownField: null, RadioField: null, CheckboxField: false}}, { id: 'isEqual', name: 'ist gleich', defaultValue: { DropdownField: null, RadioField: null, CheckboxField: false } },
{id: 'isNotEqual', name: 'ist ungleich', defaultValue: {DropdownField: null, RadioField: null, CheckboxField: false}}, { id: 'isNotEqual', name: 'ist ungleich', defaultValue: { DropdownField: null, RadioField: null, CheckboxField: false } },
{id: 'isIn', name: 'ist in', defaultValue: {DropdownField: [], RadioField: [], CheckboxField: false}}, { id: 'isIn', name: 'ist in', defaultValue: { DropdownField: [], RadioField: [], CheckboxField: false } },
{id: 'isNotIn', name: 'ist nicht in', defaultValue: {DropdownField: [], RadioField: [], CheckboxField: false}}, { id: 'isNotIn', name: 'ist nicht in', defaultValue: { DropdownField: [], RadioField: [], CheckboxField: false } },
]); ]);
const modeOptions = ref([ const modeOptions = ref([
{id: 'all', name: 'alle Bedingungen müssen zutreffen'}, { id: 'all', name: 'alle Bedingungen müssen zutreffen' },
{id: 'any', name: 'mindestens eine Bedingung muss zutreffen'}, { id: 'any', name: 'mindestens eine Bedingung muss zutreffen' },
]); ]);
const fields = computed(() => { const fields = computed(() => {
@ -119,13 +119,13 @@ function getField(fieldName) {
function getOptions(fieldName) { function getOptions(fieldName) {
return getField(fieldName).options.map((o) => { return getField(fieldName).options.map((o) => {
return {id: o, name: o}; return { id: o, name: o };
}); });
} }
const fieldOptions = computed(() => const fieldOptions = computed(() =>
fields.value.map((field) => { fields.value.map((field) => {
return {id: field.key, name: field.name}; return { id: field.key, name: field.name };
}) })
); );
@ -146,7 +146,7 @@ async function save() {
} }
async function checkIfDirty() { async function checkIfDirty() {
const response = await axios.post(props.single.links.is_dirty, {config: props.single.config}); const response = await axios.post(props.single.links.is_dirty, { config: props.single.config });
locked.value = response.data.result; locked.value = response.data.result;
} }

View File

@ -172,16 +172,16 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref, inject, computed} from 'vue'; import { ref, inject, computed } from 'vue';
import {indexProps, useIndex} from '../../composables/useInertiaApiIndex.js'; import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
import FormBuilder from '../formtemplate/FormBuilder.vue'; import FormBuilder from '../formtemplate/FormBuilder.vue';
import Participants from './Participants.vue'; import Participants from './Participants.vue';
import Conditions from './Conditions.vue'; import Conditions from './Conditions.vue';
import {useToast} from 'vue-toastification'; import { useToast } from 'vue-toastification';
const props = defineProps(indexProps); const props = defineProps(indexProps);
var {meta, data, reloadPage, create, single, edit, cancel, submit, remove, getFilter, setFilter} = useIndex(props.data, 'form'); var { meta, data, reloadPage, create, single, edit, cancel, submit, remove, getFilter, setFilter } = useIndex(props.data, 'form');
const axios = inject('axios'); const axios = inject('axios');
const toast = useToast(); const toast = useToast();
@ -191,8 +191,8 @@ const deleting = ref(null);
const showing = ref(null); const showing = ref(null);
const fileSettingPopup = ref(null); const fileSettingPopup = ref(null);
const tabs = [{title: 'Allgemeines'}, {title: 'Formular'}, {title: 'Bestätigungs-E-Mail'}, {title: 'Export'}]; const tabs = [{ title: 'Allgemeines' }, { title: 'Formular' }, { title: 'Bestätigungs-E-Mail' }, { title: 'Export' }];
const mailTabs = [{title: 'vor Daten'}, {title: 'nach Daten'}]; const mailTabs = [{ title: 'vor Daten' }, { title: 'nach Daten' }];
const allFields = computed(() => { const allFields = computed(() => {
if (!single.value) { if (!single.value) {
@ -202,7 +202,7 @@ const allFields = computed(() => {
var result = []; var result = [];
single.value.config.sections.forEach((section) => { single.value.config.sections.forEach((section) => {
section.fields.forEach((field) => { section.fields.forEach((field) => {
result.push({id: field.key, name: field.name}); result.push({ id: field.key, name: field.name });
}); });
}); });

View File

@ -21,12 +21,12 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
import {computed, ref} from 'vue'; import { computed, ref } from 'vue';
import useSearch from '../../composables/useSearch.js'; import useSearch from '../../composables/useSearch.js';
const emit = defineEmits(['assign']); const emit = defineEmits(['assign']);
const {search} = useSearch(); const { search } = useSearch();
const realSearchString = ref(''); const realSearchString = ref('');
const results = ref(null); const results = ref(null);
@ -40,7 +40,7 @@ const searchString = computed({
results.value = null; results.value = null;
return; return;
} }
results.value = await search(v, [], {limit: 10}); results.value = await search(v, [], { limit: 10 });
}, },
}); });
</script> </script>

View File

@ -108,14 +108,14 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
import {watch, ref, computed} from 'vue'; import { watch, ref, computed } from 'vue';
import {useApiIndex} from '../../composables/useApiIndex.js'; import { useApiIndex } from '../../composables/useApiIndex.js';
import useTableToggle from '../../composables/useTableToggle.js'; import useTableToggle from '../../composables/useTableToggle.js';
import MemberAssign from './MemberAssign.vue'; import MemberAssign from './MemberAssign.vue';
const deleting = ref(null); const deleting = ref(null);
const {isOpen, toggle, childrenOf, clearToggle} = useTableToggle({}); const { isOpen, toggle, childrenOf, clearToggle } = useTableToggle({});
const assigning = ref(null); const assigning = ref(null);
@ -149,12 +149,12 @@ const groupParticipants = computed({
}); });
async function assign(memberId) { async function assign(memberId) {
await axios.post(assigning.value.links.assign, {member_id: memberId}); await axios.post(assigning.value.links.assign, { member_id: memberId });
reload(false); reload(false);
assigning.value = null; assigning.value = null;
} }
var {meta, data, reload, reloadPage, axios, remove, toFilterString, url, updateUrl} = useApiIndex(props.hasNamiField ? props.rootUrl : props.url, 'participant'); var { meta, data, reload, reloadPage, axios, remove, toFilterString, url, updateUrl } = useApiIndex(props.hasNamiField ? props.rootUrl : props.url, 'participant');
const activeColumns = computed(() => meta.value.columns.filter((c) => meta.value.form_meta.active_columns.includes(c.id))); const activeColumns = computed(() => meta.value.columns.filter((c) => meta.value.form_meta.active_columns.includes(c.id)));
@ -186,19 +186,19 @@ watch(
filter: toFilterString(newValue), filter: toFilterString(newValue),
}); });
}, },
{deep: true} { deep: true }
); );
const checkboxFilterOptions = ref([ const checkboxFilterOptions = ref([
{id: true, name: 'Ja'}, { id: true, name: 'Ja' },
{id: false, name: 'Nein'}, { id: false, name: 'Nein' },
]); ]);
function dropdownFilterOptions(filter) { function dropdownFilterOptions(filter) {
return [ return [
{id: null, name: 'keine Auswahl'}, { id: null, name: 'keine Auswahl' },
...filter.options.map((f) => { ...filter.options.map((f) => {
return {id: f, name: f}; return { id: f, name: f };
}), }),
]; ];
} }

View File

@ -14,7 +14,7 @@
</ui-box> </ui-box>
</template> </template>
<script setup> <script lang="js" setup>
const emit = defineEmits(['close', 'submit']); const emit = defineEmits(['close', 'submit']);
const props = defineProps({ const props = defineProps({

View File

@ -17,7 +17,7 @@
></f-textarea> ></f-textarea>
</template> </template>
<script setup> <script lang="js" setup>
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
meta: {}, meta: {},

View File

@ -30,9 +30,9 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
import useElements from './useElements.js'; import useElements from './useElements.js';
const {addOption, setOption, removeOption} = useElements(); const { addOption, setOption, removeOption } = useElements();
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},

View File

@ -42,7 +42,7 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
defineEmits(['update:modelValue']); defineEmits(['update:modelValue']);
const props = defineProps({ const props = defineProps({

View File

@ -19,7 +19,7 @@
></f-switch> ></f-switch>
</template> </template>
<script setup> <script lang="js" setup>
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
meta: {}, meta: {},

View File

@ -71,9 +71,9 @@
</form> </form>
</template> </template>
<script setup> <script lang="js" setup>
import {watch, computed, ref} from 'vue'; import { watch, computed, ref } from 'vue';
import {snakeCase} from 'change-case'; import { snakeCase } from 'change-case';
import '!/adrema-form/dist/main.js'; import '!/adrema-form/dist/main.js';
import Asideform from './Asideform.vue'; import Asideform from './Asideform.vue';
import TextareaField from './TextareaField.vue'; import TextareaField from './TextareaField.vue';
@ -95,7 +95,7 @@ const active = ref(null);
async function onReorder() { async function onReorder() {
var order = this.inner.map((f) => f.id); var order = this.inner.map((f) => f.id);
this.loading = true; this.loading = true;
This.inner = (await this.axios.patch(`/mediaupload/${this.parentName}/${this.parentId}/${this.collection}`, {order})).data; This.inner = (await this.axios.patch(`/mediaupload/${this.parentName}/${this.parentId}/${this.collection}`, { order })).data;
this.loading = false; this.loading = false;
} }
@ -126,7 +126,7 @@ const fields = {
function editSection(sectionIndex) { function editSection(sectionIndex) {
singleSection.value = { singleSection.value = {
model: {...inner.value.sections[sectionIndex]}, model: { ...inner.value.sections[sectionIndex] },
index: sectionIndex, index: sectionIndex,
mode: 'edit', mode: 'edit',
}; };
@ -134,7 +134,7 @@ function editSection(sectionIndex) {
function startReordering(index) { function startReordering(index) {
singleSection.value = { singleSection.value = {
model: {...inner.value.sections[index]}, model: { ...inner.value.sections[index] },
index: index, index: index,
mode: 'reorder', mode: 'reorder',
}; };

View File

@ -45,8 +45,8 @@
></f-select> ></f-select>
</template> </template>
<script setup> <script lang="js" setup>
import {computed} from 'vue'; import { computed } from 'vue';
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
@ -57,7 +57,7 @@ const props = defineProps({
const fieldOptions = computed(() => { const fieldOptions = computed(() => {
return props.payload.reduce((carry, section) => { return props.payload.reduce((carry, section) => {
return section.fields.reduce((fcarry, field) => { return section.fields.reduce((fcarry, field) => {
return field.type === 'GroupField' ? fcarry.concat({id: field.key, name: field.name}) : fcarry; return field.type === 'GroupField' ? fcarry.concat({ id: field.key, name: field.name }) : fcarry;
}, carry); }, carry);
}, []); }, []);
}); });

View File

@ -58,15 +58,15 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref} from 'vue'; import { ref } from 'vue';
import {indexProps, useIndex} from '../../composables/useInertiaApiIndex.js'; import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
import FormBuilder from './FormBuilder.vue'; import FormBuilder from './FormBuilder.vue';
const deleting = ref(null); const deleting = ref(null);
const props = defineProps(indexProps); const props = defineProps(indexProps);
var {meta, data, reloadPage, create, remove, single, edit, cancel, submit} = useIndex(props.data, 'invoice'); var { meta, data, reloadPage, create, remove, single, edit, cancel, submit } = useIndex(props.data, 'invoice');
function innerSubmit(payload) { function innerSubmit(payload) {
single.value = payload; single.value = payload;

View File

@ -12,7 +12,7 @@
<f-text id="max" :model-value="modelValue.max" label="maximaler Wert" size="sm" type="number" @update:modelValue="$emit('update:modelValue', {...modelValue, max: parse($event)})"></f-text> <f-text id="max" :model-value="modelValue.max" label="maximaler Wert" size="sm" type="number" @update:modelValue="$emit('update:modelValue', {...modelValue, max: parse($event)})"></f-text>
</template> </template>
<script setup> <script lang="js" setup>
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
meta: {}, meta: {},

View File

@ -38,9 +38,9 @@
></f-switch> ></f-switch>
</template> </template>
<script setup> <script lang="js" setup>
import useElements from './useElements.js'; import useElements from './useElements.js';
const {addOption, setOption, removeOption} = useElements(); const { addOption, setOption, removeOption } = useElements();
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},

View File

@ -10,7 +10,7 @@
></f-switch> ></f-switch>
</template> </template>
<script setup> <script lang="js" setup>
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
meta: {}, meta: {},

View File

@ -11,7 +11,7 @@
></f-switch> ></f-switch>
</template> </template>
<script setup> <script lang="js" setup>
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
meta: {}, meta: {},

View File

@ -92,14 +92,14 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref} from 'vue'; import { ref } from 'vue';
import {indexProps, useIndex} from '../../composables/useInertiaApiIndex.js'; import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
import useTableToggle from '../../composables/useTableToggle.js'; import useTableToggle from '../../composables/useTableToggle.js';
const props = defineProps(indexProps); const props = defineProps(indexProps);
var {axios, meta, data} = useIndex(props.data, 'invoice'); var { axios, meta, data } = useIndex(props.data, 'invoice');
const {isOpen, toggle, childrenOf} = useTableToggle({null: data.value}); const { isOpen, toggle, childrenOf } = useTableToggle({ null: data.value });
var editing = ref(null); var editing = ref(null);

View File

@ -124,14 +124,14 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref} from 'vue'; import { ref } from 'vue';
import {indexProps, useIndex} from '../../composables/useInertiaApiIndex.js'; import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
const props = defineProps(indexProps); const props = defineProps(indexProps);
var {axios, meta, data, reloadPage, create, single, edit, cancel, submit, remove, getFilter, setFilter} = useIndex(props.data, 'invoice'); var { axios, meta, data, reloadPage, create, single, edit, cancel, submit, remove, getFilter, setFilter } = useIndex(props.data, 'invoice');
const massstore = ref(null); const massstore = ref(null);
const deleting = ref(null); const deleting = ref(null);
const forMember = ref({member_id: null, subscription_id: null, year: null}); const forMember = ref({ member_id: null, subscription_id: null, year: null });
async function saveForMember() { async function saveForMember() {
single.value = (await axios.post(meta.value.links.newInvoiceAttributes, forMember.value)).data; single.value = (await axios.post(meta.value.links.newInvoiceAttributes, forMember.value)).data;

View File

@ -74,9 +74,9 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {ref, inject, defineProps} from 'vue'; import { ref, inject, defineProps } from 'vue';
import {useIndex} from '../../composables/useIndex.js'; import { useIndex } from '../../composables/useIndex.js';
const props = defineProps({ const props = defineProps({
data: { data: {
@ -85,13 +85,13 @@ const props = defineProps({
}, },
meta: { meta: {
type: Object, type: Object,
default: () => {}, default: () => { },
}, },
}); });
const {router} = useIndex({data: [], meta: {}}, 'maildispatcher'); const { router } = useIndex({ data: [], meta: {} }, 'maildispatcher');
const model = ref(props.data === undefined ? {...props.meta.default_model} : {...props.data}); const model = ref(props.data === undefined ? { ...props.meta.default_model } : { ...props.data });
const members = ref(null); const members = ref(null);
const axios = inject('axios'); const axios = inject('axios');

View File

@ -77,12 +77,12 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import {indexProps, useIndex} from '../../composables/useInertiaApiIndex.js'; import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
import SettingLayout from '../setting/Layout.vue'; import SettingLayout from '../setting/Layout.vue';
const props = defineProps(indexProps); const props = defineProps(indexProps);
const {meta, data, create, edit, cancel, single, submit} = useIndex(props.data, 'mailgateway'); const { meta, data, create, edit, cancel, single, submit } = useIndex(props.data, 'mailgateway');
function getType(type) { function getType(type) {
return meta.value.types.find((t) => t.id === type); return meta.value.types.find((t) => t.id === type);

View File

@ -2,17 +2,14 @@
<div class="sidebar flex flex-col group is-bright"> <div class="sidebar flex flex-col group is-bright">
<page-header title="Ausbildungen" @close="$emit('close')"> <page-header title="Ausbildungen" @close="$emit('close')">
<template #toolbar> <template #toolbar>
<page-toolbar-button v-if="single === null" color="primary" icon="plus" @click.prevent="create">Neue <page-toolbar-button v-if="single === null" color="primary" icon="plus" @click.prevent="create">Neue Ausbildung</page-toolbar-button>
Ausbildung</page-toolbar-button> <page-toolbar-button v-if="single !== null" color="primary" icon="undo" @click.prevent="cancel">Zurück</page-toolbar-button>
<page-toolbar-button v-if="single !== null" color="primary" icon="undo"
@click.prevent="cancel">Zurück</page-toolbar-button>
</template> </template>
</page-header> </page-header>
<form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit"> <form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit">
<f-text id="completed_at" v-model="single.completed_at" type="date" label="Datum" required></f-text> <f-text id="completed_at" v-model="single.completed_at" type="date" label="Datum" required></f-text>
<f-select id="course_id" v-model="single.course_id" name="course_id" :options="meta.courses" label="Baustein" <f-select id="course_id" v-model="single.course_id" name="course_id" :options="meta.courses" label="Baustein" required></f-select>
required></f-select>
<f-text id="event_name" v-model="single.event_name" label="Veranstaltung" required></f-text> <f-text id="event_name" v-model="single.event_name" label="Veranstaltung" required></f-text>
<f-text id="organizer" v-model="single.organizer" label="Veranstalter" required></f-text> <f-text id="organizer" v-model="single.organizer" label="Veranstalter" required></f-text>
<button type="submit" class="btn btn-primary">Absenden</button> <button type="submit" class="btn btn-primary">Absenden</button>
@ -34,10 +31,8 @@
<td v-text="course.organizer"></td> <td v-text="course.organizer"></td>
<td v-text="course.completed_at_human"></td> <td v-text="course.completed_at_human"></td>
<td class="flex"> <td class="flex">
<a href="#" class="inline-flex btn btn-warning btn-sm" @click.prevent="edit(course)"><ui-sprite <a href="#" class="inline-flex btn btn-warning btn-sm" @click.prevent="edit(course)"><ui-sprite src="pencil"></ui-sprite></a>
src="pencil"></ui-sprite></a> <a href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="remove(course)"><ui-sprite src="trash"></ui-sprite></a>
<a href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="remove(course)"><ui-sprite
src="trash"></ui-sprite></a>
</td> </td>
</tr> </tr>
</table> </table>
@ -45,7 +40,7 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
defineEmits(['close']); defineEmits(['close']);
import { useApiIndex } from '../../composables/useApiIndex.js'; import { useApiIndex } from '../../composables/useApiIndex.js';

View File

@ -18,7 +18,7 @@
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
defineEmits(['close']); defineEmits(['close']);
import { useApiIndex } from '../../composables/useApiIndex.js'; import { useApiIndex } from '../../composables/useApiIndex.js';

View File

@ -1,25 +1,25 @@
<template> <template>
<page-header title="Mitgliedschaften" @close="$emit('close')"> <page-header title="Mitgliedschaften" @close="$emit('close')">
<template #toolbar> <template #toolbar>
<page-toolbar-button v-if="single === null" color="primary" icon="plus" @click.prevent="create">Neue <page-toolbar-button v-if="single === null" color="primary" icon="plus" @click.prevent="create">Neue Mitgliedschaft</page-toolbar-button>
Mitgliedschaft</page-toolbar-button> <page-toolbar-button v-if="single !== null" color="primary" icon="undo" @click.prevent="single = null">Zurück</page-toolbar-button>
<page-toolbar-button v-if="single !== null" color="primary" icon="undo"
@click.prevent="single = null">Zurück</page-toolbar-button>
</template> </template>
</page-header> </page-header>
<form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit"> <form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit">
<f-select id="group_id" v-model="single.group_id" name="group_id" :options="meta.groups" label="Gruppierung" <f-select id="group_id" v-model="single.group_id" name="group_id" :options="meta.groups" label="Gruppierung" required></f-select>
required></f-select> <f-select id="activity_id" v-model="single.activity_id" name="activity_id" :options="meta.activities" label="Tätigkeit" required></f-select>
<f-select id="activity_id" v-model="single.activity_id" name="activity_id" :options="meta.activities" <f-select
label="Tätigkeit" required></f-select> v-if="single.activity_id"
<f-select v-if="single.activity_id" id="subactivity_id" :model-value="single.subactivity_id" name="subactivity_id" id="subactivity_id"
:options="meta.subactivities[single.activity_id]" label="Untertätigkeit" :model-value="single.subactivity_id"
@update:modelValue="setSubactivityId(single, $event)"></f-select> name="subactivity_id"
<f-switch v-if="displayPromisedAt" id="has_promise" :model-value="single.promised_at !== null" :options="meta.subactivities[single.activity_id]"
label="Hat Versprechen" @update:modelValue="setPromisedAtSwitch(single, $event)"></f-switch> label="Untertätigkeit"
<f-text v-show="displayPromisedAt && single.promised_at !== null" id="promised_at" v-model="single.promised_at" @update:modelValue="setSubactivityId(single, $event)"
type="date" label="Versprechensdatum" size="sm"></f-text> ></f-select>
<f-switch v-if="displayPromisedAt" id="has_promise" :model-value="single.promised_at !== null" label="Hat Versprechen" @update:modelValue="setPromisedAtSwitch(single, $event)"></f-switch>
<f-text v-show="displayPromisedAt && single.promised_at !== null" id="promised_at" v-model="single.promised_at" type="date" label="Versprechensdatum" size="sm"></f-text>
<button type="submit" class="btn btn-primary">Absenden</button> <button type="submit" class="btn btn-primary">Absenden</button>
</form> </form>
@ -39,17 +39,15 @@
<td v-text="membership.human_date"></td> <td v-text="membership.human_date"></td>
<td><ui-boolean-display :value="membership.is_active" dark></ui-boolean-display></td> <td><ui-boolean-display :value="membership.is_active" dark></ui-boolean-display></td>
<td class="flex space-x-1"> <td class="flex space-x-1">
<a href="#" class="inline-flex btn btn-warning btn-sm" @click.prevent="edit(membership)"><ui-sprite <a href="#" class="inline-flex btn btn-warning btn-sm" @click.prevent="edit(membership)"><ui-sprite src="pencil"></ui-sprite></a>
src="pencil"></ui-sprite></a> <a href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="remove(membership)"><ui-sprite src="trash"></ui-sprite></a>
<a href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="remove(membership)"><ui-sprite
src="trash"></ui-sprite></a>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
import { computed } from 'vue'; import { computed } from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';

View File

@ -132,21 +132,21 @@
</page-layout> </page-layout>
</template> </template>
<script setup> <script lang="js" setup>
import MemberInvoicePositions from './MemberInvoicePositions.vue'; import MemberInvoicePositions from './MemberInvoicePositions.vue';
import MemberMemberships from './MemberMemberships.vue'; import MemberMemberships from './MemberMemberships.vue';
import MemberCourses from './MemberCourses.vue'; import MemberCourses from './MemberCourses.vue';
import Tags from './Tags.vue'; import Tags from './Tags.vue';
import Actions from './index/Actions.vue'; import Actions from './index/Actions.vue';
import {indexProps, useIndex} from '../../composables/useIndex.js'; import { indexProps, useIndex } from '../../composables/useIndex.js';
import {ref, defineProps} from 'vue'; import { ref, defineProps } from 'vue';
const single = ref(null); const single = ref(null);
const deleting = ref(null); const deleting = ref(null);
const membershipFilters = ref(null); const membershipFilters = ref(null);
const props = defineProps(indexProps); const props = defineProps(indexProps);
var {router, data, meta, getFilter, setFilter, filterString, reloadPage} = useIndex(props.data, 'member'); var { router, data, meta, getFilter, setFilter, filterString, reloadPage } = useIndex(props.data, 'member');
function exportMembers() { function exportMembers() {
window.open(`/member-export?filter=${filterString.value}`); window.open(`/member-export?filter=${filterString.value}`);
@ -154,7 +154,7 @@ function exportMembers() {
async function remove(member) { async function remove(member) {
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
deleting.value = {resolve, reject, member}; deleting.value = { resolve, reject, member };
}) })
.then(() => { .then(() => {
router.delete(`/member/${member.id}`); router.delete(`/member/${member.id}`);

View File

@ -1,23 +1,20 @@
<template> <template>
<div class="flex space-x-1"> <div class="flex space-x-1">
<i-link v-tooltip="`Details`" :href="member.links.show" class="inline-flex btn btn-primary btn-sm"><ui-sprite <i-link v-tooltip="`Details`" :href="member.links.show" class="inline-flex btn btn-primary btn-sm"><ui-sprite src="eye"></ui-sprite></i-link>
src="eye"></ui-sprite></i-link> <i-link v-tooltip="`Bearbeiten`" :href="member.links.edit" class="inline-flex btn btn-warning btn-sm"><ui-sprite src="pencil"></ui-sprite></i-link>
<i-link v-tooltip="`Bearbeiten`" :href="member.links.edit" class="inline-flex btn btn-warning btn-sm"><ui-sprite <a v-show="hasModule('bill')" v-tooltip="`Zahlungen`" href="#" class="inline-flex btn btn-info btn-sm" @click.prevent="$emit('sidebar', 'invoicePosition')"
src="pencil"></ui-sprite></i-link> ><ui-sprite src="money"></ui-sprite
<a v-show="hasModule('bill')" v-tooltip="`Zahlungen`" href="#" class="inline-flex btn btn-info btn-sm" ></a>
@click.prevent="$emit('sidebar', 'invoicePosition')"><ui-sprite src="money"></ui-sprite></a> <a v-show="hasModule('courses')" v-tooltip="`Ausbildungen`" href="#" class="inline-flex btn btn-info btn-sm" @click.prevent="$emit('sidebar', 'courses')"
<a v-show="hasModule('courses')" v-tooltip="`Ausbildungen`" href="#" class="inline-flex btn btn-info btn-sm" ><ui-sprite src="course"></ui-sprite
@click.prevent="$emit('sidebar', 'courses')"><ui-sprite src="course"></ui-sprite></a> ></a>
<a v-tooltip="`Mitgliedschaften`" href="#" class="inline-flex btn btn-info btn-sm" <a v-tooltip="`Mitgliedschaften`" href="#" class="inline-flex btn btn-info btn-sm" @click.prevent="$emit('sidebar', 'membership')"><ui-sprite src="user"></ui-sprite></a>
@click.prevent="$emit('sidebar', 'membership')"><ui-sprite src="user"></ui-sprite></a> <a v-show="member.efz_link" v-tooltip="`EFZ Formular`" :href="member.efz_link" class="inline-flex btn btn-info btn-sm"><ui-sprite src="report"></ui-sprite></a>
<a v-show="member.efz_link" v-tooltip="`EFZ Formular`" :href="member.efz_link" <a v-tooltip="`Entfernen`" href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="$emit('remove')"><ui-sprite src="trash"></ui-sprite></a>
class="inline-flex btn btn-info btn-sm"><ui-sprite src="report"></ui-sprite></a>
<a v-tooltip="`Entfernen`" href="#" class="inline-flex btn btn-danger btn-sm"
@click.prevent="$emit('remove')"><ui-sprite src="trash"></ui-sprite></a>
</div> </div>
</template> </template>
<script setup> <script lang="js" setup>
defineProps({ defineProps({
member: { member: {
type: Object, type: Object,