Plugin-System; Neuigkeiten und Termine als mitgelieferte Plugins
- Plugins nach WordPress-Prinzip: plugin.json-Manifest mit Versions- und Abhängigkeitsprüfung, eigenes PSR-4-Autoloading, register()/boot(), activate()/deactivate()/uninstall(), Migrationen, Routen und Views je Plugin - plugins-core/ (mitgeliefert, aktiv bis zur Deaktivierung) und plugins/ (Kunden-Plugins, geschützt vor Updates, inaktiv bis zur Aktivierung) - Zustand in storage/app/plugins.json – Laden ohne Datenbankabfrage - Wiederherstellungsmodus: Ausnahmen und Fatal Errors beim Laden deaktivieren das Plugin, das Portal bleibt erreichbar - Hooks (Actions/Filter mit Prioritäten) und Registries für Navigation, Startseiten-Kacheln, Rechte und Admin-Seiten (Filament-Discovery) - Admin-Seite „Plugins“: aktivieren, deaktivieren, per ZIP installieren (ZIP-Slip-Schutz), löschen mit oder ohne Daten; abschaltbar per INHAUS_DISALLOW_FILE_MODS - Startseite komplett aus Kacheln; Plugin-Seiten als „slug::Seite“ - Version 0.3.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cc0020458f
commit
28ef1e4a20
155 changed files with 2762 additions and 573 deletions
|
|
@ -1,9 +0,0 @@
|
|||
<script setup>
|
||||
defineProps({
|
||||
category: { type: Object, default: null },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-if="category" class="text-[11px] font-semibold tracking-wide text-brand-text uppercase">{{ category.name }}</span>
|
||||
</template>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { dateBlock } from '@/lib/format';
|
||||
|
||||
const props = defineProps({
|
||||
date: { type: String, required: true },
|
||||
});
|
||||
|
||||
const block = computed(() => dateBlock(props.date));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid w-12 shrink-0 place-items-center rounded-md bg-muted py-1.5 leading-none">
|
||||
<span class="text-xl font-semibold">{{ block.day }}</span>
|
||||
<span class="mt-1 text-[10px] font-semibold tracking-wide text-muted-foreground">{{ block.month }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import EventDateBlock from '@/components/EventDateBlock.vue';
|
||||
import { formatEventRange } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
event: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Link :href="`/termine/${event.id}`" class="group flex items-start gap-3.5 py-3">
|
||||
<EventDateBlock :date="event.starts_at" />
|
||||
<div class="min-w-0 pt-0.5">
|
||||
<h3 class="line-clamp-2 text-sm leading-snug font-semibold group-hover:underline">{{ event.title }}</h3>
|
||||
<p class="mt-0.5 text-xs text-muted-foreground">{{ formatEventRange(event) }}</p>
|
||||
<p v-if="event.location" class="truncate text-xs text-muted-foreground">{{ event.location }}</p>
|
||||
</div>
|
||||
</Link>
|
||||
</template>
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
<script setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { ArrowRight, ChevronLeft, ChevronRight, Pause, Play } from '@lucide/vue';
|
||||
|
||||
const props = defineProps({
|
||||
posts: { type: Array, required: true },
|
||||
});
|
||||
|
||||
const index = ref(0);
|
||||
const paused = ref(false);
|
||||
const current = computed(() => props.posts[index.value]);
|
||||
let timer = null;
|
||||
|
||||
function go(to) {
|
||||
index.value = (to + props.posts.length) % props.posts.length;
|
||||
}
|
||||
|
||||
function start() {
|
||||
stop();
|
||||
|
||||
if (props.posts.length > 1 && !paused.value && !window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||||
timer = setInterval(() => go(index.value + 1), 7000);
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
function togglePause() {
|
||||
paused.value = !paused.value;
|
||||
start();
|
||||
}
|
||||
|
||||
onMounted(start);
|
||||
onBeforeUnmount(stop);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section
|
||||
class="relative isolate aspect-[16/10] overflow-hidden rounded-lg bg-brand-950 text-white sm:aspect-[16/9] lg:aspect-auto lg:h-full lg:min-h-[400px]"
|
||||
aria-roledescription="Karussell"
|
||||
aria-label="Hervorgehobene Neuigkeiten"
|
||||
@mouseenter="stop"
|
||||
@mouseleave="start"
|
||||
@focusin="stop"
|
||||
@focusout="start"
|
||||
>
|
||||
<TransitionGroup
|
||||
enter-active-class="transition-opacity duration-700"
|
||||
leave-active-class="transition-opacity duration-700 absolute inset-0"
|
||||
enter-from-class="opacity-0"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<img
|
||||
v-for="(post, i) in posts"
|
||||
v-show="i === index"
|
||||
:key="post.id"
|
||||
:src="post.cover_url"
|
||||
alt=""
|
||||
class="absolute inset-0 -z-10 size-full object-cover"
|
||||
/>
|
||||
</TransitionGroup>
|
||||
<div class="absolute inset-0 -z-10 bg-gradient-to-t from-black/80 via-black/35 to-black/5 sm:bg-gradient-to-r sm:from-black/75 sm:via-black/40 sm:to-transparent" />
|
||||
|
||||
<div class="flex h-full flex-col justify-end p-6 sm:max-w-[65%] sm:justify-center sm:p-10" aria-live="polite">
|
||||
<span v-if="current.category" class="mb-3 w-fit rounded-sm bg-brand px-2 py-0.5 text-[11px] font-semibold tracking-wide text-brand-foreground uppercase">
|
||||
{{ current.category.name }}
|
||||
</span>
|
||||
<h2 class="text-2xl leading-tight font-semibold tracking-tight sm:text-[32px]">{{ current.title }}</h2>
|
||||
<p v-if="current.teaser" class="mt-3 line-clamp-3 hidden text-[15px] text-white/85 sm:block">{{ current.teaser }}</p>
|
||||
<Link
|
||||
:href="`/neuigkeiten/${current.slug}`"
|
||||
class="mt-5 inline-flex w-fit items-center gap-2 rounded-md bg-brand px-4 py-2.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand-700"
|
||||
>
|
||||
Mehr erfahren
|
||||
<ArrowRight class="size-4" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div v-if="posts.length > 1" class="absolute right-4 bottom-4 flex items-center gap-2 sm:right-6 sm:bottom-6">
|
||||
<button type="button" class="grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55" aria-label="Vorheriger Beitrag" @click="go(index - 1)">
|
||||
<ChevronLeft class="size-5" />
|
||||
</button>
|
||||
<div class="flex items-center gap-1.5 px-1">
|
||||
<button
|
||||
v-for="(post, i) in posts"
|
||||
:key="post.id"
|
||||
type="button"
|
||||
class="h-1.5 rounded-full transition-all"
|
||||
:class="i === index ? 'w-6 bg-white' : 'w-1.5 bg-white/50 hover:bg-white/80'"
|
||||
:aria-label="`Beitrag ${i + 1} von ${posts.length}`"
|
||||
:aria-current="i === index"
|
||||
@click="go(i)"
|
||||
/>
|
||||
</div>
|
||||
<button type="button" class="grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55" aria-label="Nächster Beitrag" @click="go(index + 1)">
|
||||
<ChevronRight class="size-5" />
|
||||
</button>
|
||||
<button type="button" class="grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55" :aria-label="paused ? 'Automatisch weiterblättern' : 'Anhalten'" @click="togglePause">
|
||||
<Play v-if="paused" class="size-4" />
|
||||
<Pause v-else class="size-4" />
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import CategoryLabel from '@/components/CategoryLabel.vue';
|
||||
import NewsImage from '@/components/NewsImage.vue';
|
||||
import { formatShortDate } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
post: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Link :href="`/neuigkeiten/${post.slug}`" class="group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md">
|
||||
<NewsImage :src="post.thumb_url" :alt="post.title" />
|
||||
<div class="flex flex-1 flex-col p-4">
|
||||
<CategoryLabel :category="post.category" />
|
||||
<h3 class="mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline">{{ post.title }}</h3>
|
||||
<p v-if="post.teaser" class="mt-1.5 line-clamp-2 text-[13px] text-muted-foreground">{{ post.teaser }}</p>
|
||||
<p class="mt-auto pt-3 text-xs text-muted-foreground">{{ formatShortDate(post.published_at) }} · {{ post.reading_minutes }} Min.</p>
|
||||
</div>
|
||||
</Link>
|
||||
</template>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<script setup>
|
||||
import { Newspaper } from '@lucide/vue';
|
||||
|
||||
defineProps({
|
||||
src: { type: String, default: null },
|
||||
alt: { type: String, default: '' },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative aspect-video overflow-hidden bg-muted">
|
||||
<img v-if="src" :src="src" :alt="alt" loading="lazy" class="size-full object-cover" />
|
||||
<div v-else class="grid size-full place-items-center bg-brand-soft">
|
||||
<Newspaper class="size-1/4 max-h-10 max-w-10 text-brand-text opacity-60" :stroke-width="1.5" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import CategoryLabel from '@/components/CategoryLabel.vue';
|
||||
import NewsImage from '@/components/NewsImage.vue';
|
||||
import { formatRelative } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
post: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Link :href="`/neuigkeiten/${post.slug}`" class="group flex gap-4 py-3">
|
||||
<NewsImage :src="post.thumb_url" :alt="post.title" class="w-28 shrink-0 rounded-md sm:w-32" />
|
||||
<div class="min-w-0">
|
||||
<CategoryLabel :category="post.category" />
|
||||
<h3 class="mt-0.5 line-clamp-2 text-sm leading-snug font-semibold group-hover:underline">{{ post.title }}</h3>
|
||||
<p class="mt-1 text-xs text-muted-foreground">{{ formatRelative(post.published_at) }}</p>
|
||||
</div>
|
||||
</Link>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue