Phase 4: Seiten mit Pagebuilder, Redaktion und Freigaben
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m40s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m40s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
- Seiten-Plugin: Seitenbaum mit Adressen, Seitennavigation, Brotkrumen und optional Hauptnavigation; Sichtbarkeit vererbt sich auf Unterseiten - Pagebuilder (Block-Registry im Kern, Plugins tragen Blöcke bei): Abschnitt, Spalten, Tabs, Akkordeon, Box, Überschrift, Text (TipTap), Zitat, Schaltflächen, Symbolliste, Tabelle, Trennlinie, Abstand, Bild, Galerie, Video (erst nach Klick), Titelbild, Ansprechpartner, Downloads, Unterseiten, Neuigkeiten, Termine; Sichtbarkeit je Block; Bereinigung beim Speichern - Editor im Portal: Ziehen und Ablegen, Autospeichern als Entwurf, Rückgängig, Gerätevorschau, Versionen, Zeitsteuerung, Bearbeitungssperre, Freigabe anfordern - Rechte „inkl. Unterseiten“ werden im Rechte-Cache aufgelöst - Neuigkeiten: Schreiben im Portal, Freigabe-Workflow mit Benachrichtigungen - Bereich „Redaktion“, Benachrichtigungen im Portal - storage/.migrations-fingerprint nicht mehr ausliefern Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6269d3302c
commit
f3987e8386
328 changed files with 10618 additions and 389 deletions
80
resources/js/components/NotificationBell.vue
Normal file
80
resources/js/components/NotificationBell.vue
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { router, usePage } from '@inertiajs/vue3';
|
||||
import { Bell, CheckCheck, FileCheck, LoaderCircle, MessageSquare, Newspaper, Undo2 } from '@lucide/vue';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||
import { http } from '@/lib/http';
|
||||
import { formatRelative } from '@/lib/format';
|
||||
|
||||
/**
|
||||
* Glocke im Header: Benachrichtigungen (z. B. Freigabe angefordert, Beitrag freigegeben).
|
||||
*/
|
||||
const page = usePage();
|
||||
const unread = computed(() => page.props.notifications?.unread ?? 0);
|
||||
const items = ref(null);
|
||||
const localUnread = ref(null);
|
||||
const count = computed(() => localUnread.value ?? unread.value);
|
||||
|
||||
const icons = { 'file-check': FileCheck, newspaper: Newspaper, undo: Undo2, message: MessageSquare };
|
||||
|
||||
async function load(open) {
|
||||
if (!open) return;
|
||||
|
||||
items.value = null;
|
||||
const data = await http.get('/benachrichtigungen');
|
||||
items.value = data.notifications;
|
||||
localUnread.value = data.unread;
|
||||
}
|
||||
|
||||
async function markAll() {
|
||||
await http.post('/benachrichtigungen/gelesen');
|
||||
items.value = items.value.map((item) => ({ ...item, read: true }));
|
||||
localUnread.value = 0;
|
||||
}
|
||||
|
||||
function open(item) {
|
||||
localUnread.value = null;
|
||||
router.visit(`/benachrichtigungen/${item.id}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Popover @update:open="load">
|
||||
<PopoverTrigger
|
||||
class="relative grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground"
|
||||
:aria-label="count ? `Benachrichtigungen, ${count} ungelesen` : 'Benachrichtigungen'"
|
||||
>
|
||||
<Bell class="size-5" />
|
||||
<span v-if="count" class="absolute top-1.5 right-1.5 grid h-4 min-w-4 place-items-center rounded-full bg-brand px-1 text-[10px] leading-none font-semibold text-brand-foreground">
|
||||
{{ count > 9 ? '9+' : count }}
|
||||
</span>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="end" class="w-[22rem] p-0">
|
||||
<div class="flex items-center justify-between border-b px-4 py-3">
|
||||
<h2 class="text-sm font-semibold">Benachrichtigungen</h2>
|
||||
<button v-if="count" type="button" class="inline-flex items-center gap-1 text-xs font-medium text-brand-text hover:underline" @click="markAll">
|
||||
<CheckCheck class="size-3.5" /> Alle gelesen
|
||||
</button>
|
||||
</div>
|
||||
<div class="max-h-[60vh] overflow-y-auto">
|
||||
<div v-if="items === null" class="grid place-items-center py-8"><LoaderCircle class="size-5 animate-spin text-muted-foreground" /></div>
|
||||
<p v-else-if="!items.length" class="px-4 py-8 text-center text-sm text-muted-foreground">Keine Benachrichtigungen.</p>
|
||||
<ul v-else class="divide-y">
|
||||
<li v-for="item in items" :key="item.id">
|
||||
<button type="button" class="flex w-full gap-3 px-4 py-3 text-left hover:bg-accent/60" @click="open(item)">
|
||||
<span class="mt-0.5 grid size-8 shrink-0 place-items-center rounded-full" :class="item.read ? 'bg-muted text-muted-foreground' : 'bg-brand-soft text-brand-text'">
|
||||
<component :is="icons[item.icon] ?? Bell" class="size-4" />
|
||||
</span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block text-sm" :class="item.read ? 'text-foreground/80' : 'font-semibold'">{{ item.title }}</span>
|
||||
<span v-if="item.body" class="mt-0.5 line-clamp-2 block text-[13px] text-muted-foreground">{{ item.body }}</span>
|
||||
<span class="mt-1 block text-xs text-muted-foreground">{{ formatRelative(item.created_at) }}</span>
|
||||
</span>
|
||||
<span v-if="!item.read" class="mt-2 size-2 shrink-0 rounded-full bg-brand" aria-label="ungelesen" />
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue