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
|
|
@ -0,0 +1,17 @@
|
|||
<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>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import EventDateBlock from './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>
|
||||
68
plugins-core/events/resources/js/pages/Index.vue
Normal file
68
plugins-core/events/resources/js/pages/Index.vue
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { CalendarDays, MapPin, Video } from '@lucide/vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import EventDateBlock from '../components/EventDateBlock.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatEventRange, formatMonthYear } from '@/lib/format';
|
||||
|
||||
const props = defineProps({
|
||||
events: { type: Object, required: true },
|
||||
});
|
||||
|
||||
// Nach Monaten gruppieren – laufende Termine erscheinen im aktuellen Monat.
|
||||
const groups = computed(() => {
|
||||
const result = [];
|
||||
|
||||
for (const event of props.events.data) {
|
||||
const start = new Date(event.starts_at);
|
||||
const shown = start < new Date() ? new Date() : start;
|
||||
const label = formatMonthYear(shown.toISOString());
|
||||
const last = result[result.length - 1];
|
||||
|
||||
if (last?.label === label) {
|
||||
last.events.push(event);
|
||||
} else {
|
||||
result.push({ label, events: [event] });
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout title="Termine">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Termine</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">Veranstaltungen, Fortbildungen und Treffen.</p>
|
||||
</div>
|
||||
|
||||
<div v-if="groups.length" class="grid max-w-4xl gap-8">
|
||||
<section v-for="group in groups" :key="group.label">
|
||||
<h2 class="mb-3 text-sm font-semibold text-muted-foreground">{{ group.label }}</h2>
|
||||
<ul class="divide-y rounded-lg border bg-card">
|
||||
<li v-for="event in group.events" :key="event.id">
|
||||
<Link :href="`/termine/${event.id}`" class="group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60">
|
||||
<EventDateBlock :date="event.starts_at" class="w-14" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<h3 class="text-[15px] font-semibold group-hover:underline">{{ event.title }}</h3>
|
||||
<p class="mt-0.5 text-[13px] text-muted-foreground">{{ formatEventRange(event) }}</p>
|
||||
<p v-if="event.location || event.online_url" class="mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground">
|
||||
<MapPin v-if="event.location" class="size-3.5" />
|
||||
<Video v-else class="size-3.5" />
|
||||
{{ event.location || 'Online' }}
|
||||
</p>
|
||||
</div>
|
||||
<img v-if="event.thumb_url" :src="event.thumb_url" alt="" loading="lazy" class="hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block" />
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div v-else class="max-w-4xl rounded-lg border border-dashed bg-card">
|
||||
<EmptyState :icon="CalendarDays" title="Keine anstehenden Termine" text="Neue Termine erscheinen hier, sobald sie eingetragen sind." />
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
66
plugins-core/events/resources/js/pages/Show.vue
Normal file
66
plugins-core/events/resources/js/pages/Show.vue
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { ArrowLeft, CalendarPlus, Clock, MapPin, Video } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import EventDateBlock from '../components/EventDateBlock.vue';
|
||||
import Panel from '@/components/Panel.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatEventRange } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
event: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="event.title">
|
||||
<div class="mx-auto max-w-4xl">
|
||||
<Link href="/termine" class="mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground">
|
||||
<ArrowLeft class="size-4" /> Alle Termine
|
||||
</Link>
|
||||
|
||||
<div class="flex items-start gap-4">
|
||||
<EventDateBlock :date="event.starts_at" class="w-16 py-2" />
|
||||
<h1 class="pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl">{{ event.title }}</h1>
|
||||
</div>
|
||||
|
||||
<img v-if="event.image_url" :src="event.image_url" :alt="event.title" class="mt-6 aspect-video w-full rounded-lg object-cover" />
|
||||
|
||||
<div class="mt-6 grid gap-6 lg:grid-cols-3">
|
||||
<Panel title="Beschreibung" class="lg:col-span-2">
|
||||
<div v-if="event.description_html" class="prose prose-neutral max-w-none text-[15px]" v-html="event.description_html" />
|
||||
<p v-else class="text-sm text-muted-foreground">Keine weiteren Informationen.</p>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Details" class="content-start">
|
||||
<dl class="grid gap-4 text-sm">
|
||||
<div class="flex gap-3">
|
||||
<Clock class="mt-0.5 size-4 shrink-0 text-muted-foreground" />
|
||||
<div>
|
||||
<dt class="text-xs text-muted-foreground">Wann</dt>
|
||||
<dd>{{ formatEventRange(event) }}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="event.location" class="flex gap-3">
|
||||
<MapPin class="mt-0.5 size-4 shrink-0 text-muted-foreground" />
|
||||
<div>
|
||||
<dt class="text-xs text-muted-foreground">Ort</dt>
|
||||
<dd>{{ event.location }}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="event.online_url" class="flex gap-3">
|
||||
<Video class="mt-0.5 size-4 shrink-0 text-muted-foreground" />
|
||||
<div class="min-w-0">
|
||||
<dt class="text-xs text-muted-foreground">Online</dt>
|
||||
<dd class="truncate"><a :href="event.online_url" target="_blank" rel="noopener" class="text-brand-text hover:underline">Zur Teilnahme</a></dd>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
<Button variant="outline" class="mt-5 w-full" as-child>
|
||||
<a :href="`/termine/${event.id}/kalender.ics`"><CalendarPlus /> In meinen Kalender</a>
|
||||
</Button>
|
||||
</Panel>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
19
plugins-core/events/resources/js/widgets/Upcoming.vue
Normal file
19
plugins-core/events/resources/js/widgets/Upcoming.vue
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<script setup>
|
||||
import { CalendarDays } from '@lucide/vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import Panel from '@/components/Panel.vue';
|
||||
import EventListItem from '../components/EventListItem.vue';
|
||||
|
||||
defineProps({
|
||||
events: { type: Array, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Panel title="Termine" action-label="Alle Termine" action-href="/termine">
|
||||
<div v-if="events.length" class="-my-3 divide-y">
|
||||
<EventListItem v-for="event in events" :key="event.id" :event="event" />
|
||||
</div>
|
||||
<EmptyState v-else :icon="CalendarDays" title="Keine anstehenden Termine" class="py-6" />
|
||||
</Panel>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue