Loheide-eu-mitarbeiterplatt.../resources/js/pagebuilder/blocks/Gallery.vue
Friederich Loheide f3987e8386
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
Phase 4: Seiten mit Pagebuilder, Redaktion und Freigaben
- 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>
2026-09-26 08:52:19 +00:00

32 lines
1.9 KiB
Vue

<script setup>
import { computed, ref } from 'vue';
import { ImageIcon } from '@lucide/vue';
import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog';
const props = defineProps({ block: { type: Object, required: true } });
const columns = { 2: '@xl:grid-cols-2', 3: '@xl:grid-cols-2 @3xl:grid-cols-3', 4: '@xl:grid-cols-3 @3xl:grid-cols-4' };
const images = computed(() => props.block.data.images.map((image, index) => ({ ...image, url: props.block.props?.urls?.[index] ?? null })));
const open = ref(null);
</script>
<template>
<div class="grid grid-cols-2 gap-3" :class="columns[block.data.columns]">
<figure v-for="(image, index) in images" :key="index">
<button v-if="image.url" type="button" class="block w-full overflow-hidden rounded-lg focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none" @click="open = image">
<img :src="image.url" :alt="image.alt" loading="lazy" class="aspect-[4/3] w-full object-cover transition-transform hover:scale-[1.02]" />
</button>
<div v-else class="grid aspect-[4/3] place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground"><ImageIcon class="size-6" /></div>
<figcaption v-if="image.caption" class="mt-1.5 text-xs text-muted-foreground">{{ image.caption }}</figcaption>
</figure>
<p v-if="!images.length" class="col-span-full text-sm text-muted-foreground">Noch keine Bilder.</p>
</div>
<Dialog :open="!!open" @update:open="(value) => !value && (open = null)">
<DialogContent class="max-w-5xl p-2 sm:max-w-5xl">
<DialogTitle class="sr-only">{{ open?.alt || 'Bild' }}</DialogTitle>
<img v-if="open" :src="open.url" :alt="open.alt" class="max-h-[80vh] w-full rounded-md object-contain" />
<p v-if="open?.caption" class="px-2 pb-1 text-sm text-muted-foreground">{{ open.caption }}</p>
</DialogContent>
</Dialog>
</template>