Neues Modul Glossar (0.27.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m52s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m46s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m2s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m31s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m54s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m58s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m52s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m46s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m2s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m31s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m54s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m58s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d148f2fbe2
commit
0bd20a527e
121 changed files with 946 additions and 298 deletions
74
plugins-core/glossar/resources/js/components/EntryDialog.vue
Normal file
74
plugins-core/glossar/resources/js/components/EntryDialog.vue
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<script setup>
|
||||
import { watch } from 'vue';
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
import FormField from '@/components/FormField.vue';
|
||||
import RichTextEditor from '@/components/RichTextEditor.vue';
|
||||
|
||||
/**
|
||||
* Begriff anlegen oder bearbeiten.
|
||||
*/
|
||||
const props = defineProps({
|
||||
entry: { type: Object, default: null },
|
||||
});
|
||||
|
||||
const open = defineModel('open', { type: Boolean, default: false });
|
||||
const form = useForm({ term: '', aliases: '', description: '', link_url: '', link_label: '' });
|
||||
|
||||
watch(open, (value) => {
|
||||
if (!value) return;
|
||||
|
||||
form.clearErrors();
|
||||
form.defaults({
|
||||
term: props.entry?.term ?? '',
|
||||
aliases: props.entry?.aliases ?? '',
|
||||
description: props.entry?.description ?? '',
|
||||
link_url: props.entry?.link_url ?? '',
|
||||
link_label: props.entry?.link_label ?? '',
|
||||
});
|
||||
form.reset();
|
||||
});
|
||||
|
||||
function submit() {
|
||||
const options = { preserveScroll: true, onSuccess: () => (open.value = false) };
|
||||
props.entry ? form.put(`/glossar/${props.entry.id}`, options) : form.post('/glossar', options);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open">
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ entry ? 'Begriff bearbeiten' : 'Begriff hinzufügen' }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
<form class="grid gap-4" @submit.prevent="submit">
|
||||
<div class="grid gap-4 sm:grid-cols-[minmax(0,1fr)_12rem]">
|
||||
<FormField id="gl-term" label="Begriff" :error="form.errors.term">
|
||||
<Input id="gl-term" v-model="form.term" maxlength="150" autofocus placeholder="z. B. Dienstvereinbarung" />
|
||||
</FormField>
|
||||
<FormField id="gl-aliases" label="Abkürzung / Synonyme" :error="form.errors.aliases">
|
||||
<Input id="gl-aliases" v-model="form.aliases" maxlength="255" placeholder="z. B. DV" />
|
||||
</FormField>
|
||||
</div>
|
||||
<FormField id="gl-description" label="Erklärung" :error="form.errors.description">
|
||||
<RichTextEditor v-model="form.description" bordered min-height="9rem" placeholder="Was bedeutet der Begriff? Wo spielt er eine Rolle?" />
|
||||
</FormField>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<FormField id="gl-link" label="Weiterlesen (optional)" :error="form.errors.link_url">
|
||||
<Input id="gl-link" v-model="form.link_url" maxlength="1000" placeholder="https://… oder /seiten/…" />
|
||||
</FormField>
|
||||
<FormField id="gl-link-label" label="Linktext" :error="form.errors.link_label">
|
||||
<Input id="gl-link-label" v-model="form.link_label" maxlength="100" placeholder="z. B. Zur Dienstvereinbarung" :disabled="!form.link_url" />
|
||||
</FormField>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" @click="open = false">Abbrechen</Button>
|
||||
<Button type="submit" :disabled="form.processing || !form.term.trim()"><LoaderCircle v-if="form.processing" class="animate-spin" /> Speichern</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue