Neuigkeiten und Termine (vorgezogen)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m8s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m5s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m6s
CI / Build-Artefakte aktuell (pull_request) Failing after 43s

- Neuigkeiten mit Kategorien, Titelbild (WebP-Varianten), Lesezeit, geplanter
  Veröffentlichung und Hervorhebung; Text wird beim Speichern bereinigt
- Termine mit Ort, Online-Link, ganztägigen Terminen und .ics-Export
- Startseite nach Intranet-Vorbild: Slider, Neuigkeiten, Termine, Aktuelles
  aus den Bereichen; mobil in sinnvoller Reihenfolge
- Admin: Beiträge, Kategorien und Termine
- Bildverarbeitung für Shared Hosting: nur eine Vollbild-Kopie im Speicher,
  Speicherlimit bei Bedarf auf 256 MB angehoben (wie WordPress)
- Demo-Inhalte für die Entwicklung

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 05:16:27 +00:00
parent f813a0fff3
commit a36752e09a
103 changed files with 2810 additions and 124 deletions

View file

@ -0,0 +1,9 @@
<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>

View file

@ -0,0 +1,16 @@
<script setup>
defineProps({
icon: { type: [Object, Function], required: true },
title: { type: String, required: true },
text: { type: String, default: '' },
});
</script>
<template>
<div class="grid place-items-center px-6 py-10 text-center">
<component :is="icon" class="size-8 text-muted-foreground" :stroke-width="1.5" />
<p class="mt-3 text-sm font-medium">{{ title }}</p>
<p v-if="text" class="mt-1 max-w-sm text-[13px] text-muted-foreground">{{ text }}</p>
<slot />
</div>
</template>

View file

@ -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>

View file

@ -0,0 +1,20 @@
<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>

View file

@ -23,19 +23,19 @@ defineProps({
<PersonAvatar :person="user" class="size-20 shrink-0 text-xl ring-4 ring-white/25" />
</div>
<nav class="grid grid-cols-3 divide-x" aria-label="Mein Bereich">
<Link :href="`/personen/${user.id}`" class="flex flex-col items-center gap-2 px-2 py-4 text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<Link :href="`/personen/${user.id}`" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<UserRound class="size-5 text-brand-text" :stroke-width="1.75" />
Mein Profil
</Link>
<Link href="/profil/bearbeiten" class="flex flex-col items-center gap-2 px-2 py-4 text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<Link href="/profil/bearbeiten" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<UserRoundPen class="size-5 text-brand-text" :stroke-width="1.75" />
Profil bearbeiten
</Link>
<a v-if="user.is_admin" href="/admin" class="flex flex-col items-center gap-2 px-2 py-4 text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<a v-if="user.is_admin" href="/admin" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<Settings class="size-5 text-brand-text" :stroke-width="1.75" />
Administration
</a>
<Link v-else href="/logout" method="post" as="button" class="flex flex-col items-center gap-2 px-2 py-4 text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<Link v-else href="/logout" method="post" as="button" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<LogOut class="size-5 text-brand-text" :stroke-width="1.75" />
Abmelden
</Link>

View file

@ -0,0 +1,107 @@
<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>

View file

@ -0,0 +1,22 @@
<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>

View file

@ -0,0 +1,17 @@
<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>

View file

@ -0,0 +1,21 @@
<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>