Feste Profilfelder in Formularen, Geburtstage, anpassbare Startseite
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m21s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m34s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 3m8s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m6s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m43s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m1s

- Formulare: Felder fest aus dem Profil (nicht änderbar, Server setzt den
  Profilwert ein), Hinweis bei fehlender Profilangabe
- Geburtstage (optionales Plugin, standardmäßig aus): Tag und Monat freiwillig
  im Profil, Kachel, Liste /geburtstage, Pagebuilder-Block, Glückwunsch am
  eigenen Geburtstag; Sichtbarkeit alle/Abteilung/Standort
- Startseite: Kacheln je Bereich sortieren und ausblenden; eigene Kacheln
  (Bild mit Link, Text, Hinweis) mit Zeitraum und Zielgruppe
- Kern: optionale mitgelieferte Plugins, Startseitenbereich „top“,
  Profilabschnitte für Plugins, Kachel-Bezeichnungen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 09:51:19 +00:00
parent 435960725d
commit ee8dde93c0
262 changed files with 2385 additions and 692 deletions

View file

@ -0,0 +1,69 @@
<script setup>
import { computed } from 'vue';
import { router, useForm } from '@inertiajs/vue3';
import { Cake, LoaderCircle } from '@lucide/vue';
import { toast } from 'vue-sonner';
import { Button } from '@/components/ui/button';
import FormField from '@/components/FormField.vue';
import NativeSelect from '@/components/NativeSelect.vue';
import Panel from '@/components/Panel.vue';
const props = defineProps({
birthday: { type: Object, default: null },
months: { type: Array, required: true },
scope: { type: String, default: 'all' },
});
const form = useForm({ day: props.birthday?.day ?? null, month: props.birthday?.month ?? null });
const days = computed(() => Array.from({ length: 31 }, (_, i) => ({ value: i + 1, label: String(i + 1) })));
const audience = { all: 'allen Mitarbeitenden', department: 'Ihrer Abteilung', location: 'Ihrem Standort' };
function save() {
form.put('/profil/geburtstag', {
preserveScroll: true,
onSuccess: () => {
form.defaults();
toast.success('Geburtstag gespeichert');
},
});
}
function remove() {
router.delete('/profil/geburtstag', {
preserveScroll: true,
onSuccess: () => {
form.day = null;
form.month = null;
form.defaults();
toast.success('Aus der Geburtstagsliste entfernt');
},
});
}
</script>
<template>
<Panel title="Geburtstag">
<form class="grid gap-4" @submit.prevent="save">
<p class="flex gap-2 text-sm text-muted-foreground">
<Cake class="mt-0.5 size-4 shrink-0 text-brand-text" />
<span>Freiwillig: Wenn Sie Tag und Monat eintragen, erscheint Ihr Geburtstag in der Geburtstagsliste und ist {{ audience[scope] }} sichtbar. Das Geburtsjahr wird nicht erfasst. Austragen ist jederzeit möglich.</span>
</p>
<div class="grid grid-cols-2 gap-4 sm:max-w-sm">
<FormField id="birthday-day" label="Tag" :error="form.errors.day">
<NativeSelect id="birthday-day" v-model="form.day" :options="days" placeholder="–" />
</FormField>
<FormField id="birthday-month" label="Monat" :error="form.errors.month">
<NativeSelect id="birthday-month" v-model="form.month" :options="months" placeholder="–" />
</FormField>
</div>
<div class="flex justify-end gap-2 border-t pt-4">
<Button v-if="birthday" type="button" variant="ghost" class="text-destructive hover:text-destructive" @click="remove">Austragen</Button>
<Button type="submit" :disabled="form.processing || !form.day || !form.month || !form.isDirty">
<LoaderCircle v-if="form.processing" class="animate-spin" />
{{ birthday ? 'Speichern' : 'Eintragen' }}
</Button>
</div>
</form>
</Panel>
</template>