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
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:
parent
f813a0fff3
commit
a36752e09a
103 changed files with 2810 additions and 124 deletions
|
|
@ -1,6 +1,7 @@
|
|||
@import "tailwindcss";
|
||||
@import "tw-animate-css";
|
||||
@import "@fontsource-variable/inter";
|
||||
@plugin "@tailwindcss/typography";
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
|
|
@ -116,3 +117,24 @@
|
|||
font-feature-settings: "cv11", "ss01";
|
||||
}
|
||||
}
|
||||
|
||||
/* Fließtext aus dem Editor (Neuigkeiten, Termine) */
|
||||
.prose {
|
||||
--tw-prose-body: var(--foreground);
|
||||
--tw-prose-headings: var(--foreground);
|
||||
--tw-prose-links: var(--brand-text);
|
||||
--tw-prose-bold: var(--foreground);
|
||||
--tw-prose-quotes: var(--foreground);
|
||||
--tw-prose-quote-borders: var(--brand-300);
|
||||
--tw-prose-bullets: var(--muted-foreground);
|
||||
--tw-prose-counters: var(--muted-foreground);
|
||||
--tw-prose-hr: var(--border);
|
||||
--tw-prose-th-borders: var(--border);
|
||||
--tw-prose-td-borders: var(--border);
|
||||
}
|
||||
|
||||
/* Anführungszeichen setzt die Redaktion selbst – keine automatischen zusätzlich. */
|
||||
.prose :where(blockquote p:first-of-type)::before,
|
||||
.prose :where(blockquote p:last-of-type)::after {
|
||||
content: none;
|
||||
}
|
||||
|
|
|
|||
9
resources/js/components/CategoryLabel.vue
Normal file
9
resources/js/components/CategoryLabel.vue
Normal 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>
|
||||
16
resources/js/components/EmptyState.vue
Normal file
16
resources/js/components/EmptyState.vue
Normal 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>
|
||||
17
resources/js/components/EventDateBlock.vue
Normal file
17
resources/js/components/EventDateBlock.vue
Normal 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>
|
||||
20
resources/js/components/EventListItem.vue
Normal file
20
resources/js/components/EventListItem.vue
Normal 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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
107
resources/js/components/HeroSlider.vue
Normal file
107
resources/js/components/HeroSlider.vue
Normal 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>
|
||||
22
resources/js/components/NewsCard.vue
Normal file
22
resources/js/components/NewsCard.vue
Normal 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>
|
||||
17
resources/js/components/NewsImage.vue
Normal file
17
resources/js/components/NewsImage.vue
Normal 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>
|
||||
21
resources/js/components/NewsListItem.vue
Normal file
21
resources/js/components/NewsListItem.vue
Normal 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>
|
||||
50
resources/js/lib/format.js
Normal file
50
resources/js/lib/format.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
const dateFormat = new Intl.DateTimeFormat('de-DE', { day: 'numeric', month: 'long', year: 'numeric' });
|
||||
const shortDateFormat = new Intl.DateTimeFormat('de-DE', { day: 'numeric', month: 'short', year: 'numeric' });
|
||||
const timeFormat = new Intl.DateTimeFormat('de-DE', { hour: '2-digit', minute: '2-digit' });
|
||||
const weekdayFormat = new Intl.DateTimeFormat('de-DE', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' });
|
||||
const monthFormat = new Intl.DateTimeFormat('de-DE', { month: 'short' });
|
||||
const monthYearFormat = new Intl.DateTimeFormat('de-DE', { month: 'long', year: 'numeric' });
|
||||
const relative = new Intl.RelativeTimeFormat('de-DE', { numeric: 'auto' });
|
||||
|
||||
export const formatDate = (iso) => dateFormat.format(new Date(iso));
|
||||
export const formatShortDate = (iso) => shortDateFormat.format(new Date(iso));
|
||||
export const formatWeekdayDate = (iso) => weekdayFormat.format(new Date(iso));
|
||||
export const formatTime = (iso) => timeFormat.format(new Date(iso));
|
||||
export const formatMonthYear = (iso) => monthYearFormat.format(new Date(iso));
|
||||
|
||||
/** „vor 2 Stunden“, „gestern“ – ab einer Woche das Datum. */
|
||||
export function formatRelative(iso) {
|
||||
const date = new Date(iso);
|
||||
const seconds = (date.getTime() - Date.now()) / 1000;
|
||||
const abs = Math.abs(seconds);
|
||||
|
||||
if (abs < 60) return 'gerade eben';
|
||||
if (abs < 3600) return relative.format(Math.round(seconds / 60), 'minute');
|
||||
if (abs < 86400) return relative.format(Math.round(seconds / 3600), 'hour');
|
||||
if (abs < 7 * 86400) return relative.format(Math.round(seconds / 86400), 'day');
|
||||
|
||||
return formatDate(iso);
|
||||
}
|
||||
|
||||
/** Tag und Monat für Datumsblöcke („22“ / „MAI“). */
|
||||
export function dateBlock(iso) {
|
||||
const date = new Date(iso);
|
||||
|
||||
return { day: date.getDate(), month: monthFormat.format(date).replace('.', '').toUpperCase() };
|
||||
}
|
||||
|
||||
/** Zeitraum eines Termins in lesbarer Form. */
|
||||
export function formatEventRange(event) {
|
||||
const start = new Date(event.starts_at);
|
||||
const end = event.ends_at ? new Date(event.ends_at) : null;
|
||||
const sameDay = end && start.toDateString() === end.toDateString();
|
||||
|
||||
if (event.all_day) {
|
||||
return end && !sameDay ? `${formatShortDate(event.starts_at)} – ${formatShortDate(event.ends_at)}` : `${formatShortDate(event.starts_at)}, ganztägig`;
|
||||
}
|
||||
|
||||
if (!end) return `${formatShortDate(event.starts_at)}, ${formatTime(event.starts_at)} Uhr`;
|
||||
if (sameDay) return `${formatShortDate(event.starts_at)}, ${formatTime(event.starts_at)} – ${formatTime(event.ends_at)} Uhr`;
|
||||
|
||||
return `${formatShortDate(event.starts_at)}, ${formatTime(event.starts_at)} Uhr – ${formatShortDate(event.ends_at)}, ${formatTime(event.ends_at)} Uhr`;
|
||||
}
|
||||
|
|
@ -1,16 +1,25 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { Link, usePage } from '@inertiajs/vue3';
|
||||
import { ArrowRight, Search, UserRoundPen } from '@lucide/vue';
|
||||
import { ArrowRight, CalendarDays, Newspaper, Search, UserRoundPen } from '@lucide/vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import EventListItem from '@/components/EventListItem.vue';
|
||||
import GreetingCard from '@/components/GreetingCard.vue';
|
||||
import QuickLinksRow from '@/components/QuickLinksRow.vue';
|
||||
import HeroSlider from '@/components/HeroSlider.vue';
|
||||
import NewsCard from '@/components/NewsCard.vue';
|
||||
import NewsListItem from '@/components/NewsListItem.vue';
|
||||
import Panel from '@/components/Panel.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import QuickLinksRow from '@/components/QuickLinksRow.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
const props = defineProps({
|
||||
profile: { type: Object, required: true },
|
||||
quickLinks: { type: Array, required: true },
|
||||
featuredNews: { type: Object, required: true },
|
||||
latestNews: { type: Object, required: true },
|
||||
moreNews: { type: Object, required: true },
|
||||
upcomingEvents: { type: Object, required: true },
|
||||
newColleagues: { type: Object, required: true },
|
||||
peopleCount: { type: Number, required: true },
|
||||
});
|
||||
|
|
@ -18,6 +27,7 @@ const props = defineProps({
|
|||
const page = usePage();
|
||||
const user = computed(() => page.props.auth.user);
|
||||
const me = computed(() => ({ ...user.value, avatar_url: props.profile.avatar_url }));
|
||||
const hasHero = computed(() => props.featuredNews.data.length > 0);
|
||||
|
||||
const greeting = computed(() => {
|
||||
const hour = new Date().getHours();
|
||||
|
|
@ -34,12 +44,43 @@ const profileIncomplete = computed(() => !props.profile.avatar_url || !props.pro
|
|||
<template>
|
||||
<AppLayout title="Startseite">
|
||||
<div class="grid grid-cols-1 gap-6 lg:grid-cols-12">
|
||||
<div class="grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8">
|
||||
<div class="grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8 xl:col-span-9 xl:grid-cols-3">
|
||||
<GreetingCard :user="me" :profile="profile" :greeting="greeting" class="lg:hidden" />
|
||||
|
||||
<QuickLinksRow :links="quickLinks" />
|
||||
<HeroSlider v-if="hasHero" :posts="featuredNews.data" class="xl:col-span-2" />
|
||||
|
||||
<Panel v-if="newColleagues.data.length" title="Neu im Team" action-label="Alle Personen" action-href="/personen">
|
||||
<Panel
|
||||
title="Neuigkeiten"
|
||||
action-label="Alle anzeigen"
|
||||
action-href="/neuigkeiten"
|
||||
:class="hasHero ? 'xl:col-span-1' : 'xl:col-span-3'"
|
||||
>
|
||||
<div v-if="latestNews.data.length" class="-my-3 divide-y" :class="{ 'sm:grid sm:grid-cols-2 sm:gap-x-6 sm:divide-y-0': !hasHero }">
|
||||
<NewsListItem v-for="post in latestNews.data" :key="post.id" :post="post" />
|
||||
</div>
|
||||
<EmptyState v-else-if="!hasHero" :icon="Newspaper" title="Noch keine Neuigkeiten" text="Sobald Beiträge veröffentlicht sind, erscheinen sie hier.">
|
||||
<a v-if="user.is_admin" href="/admin/neuigkeiten/neu" class="mt-4 text-sm font-medium text-brand-text hover:underline">Ersten Beitrag schreiben</a>
|
||||
</EmptyState>
|
||||
<p v-else class="text-sm text-muted-foreground">Keine weiteren Beiträge.</p>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Termine" class="lg:hidden" action-label="Alle Termine" action-href="/termine">
|
||||
<div v-if="upcomingEvents.data.length" class="-my-3 divide-y">
|
||||
<EventListItem v-for="event in upcomingEvents.data" :key="event.id" :event="event" />
|
||||
</div>
|
||||
<EmptyState v-else :icon="CalendarDays" title="Keine anstehenden Termine" class="py-6" />
|
||||
</Panel>
|
||||
|
||||
<QuickLinksRow :links="quickLinks" class="xl:col-span-3" />
|
||||
|
||||
<Panel v-if="moreNews.data.length" title="Aktuelles aus den Bereichen" action-label="Alle" action-href="/neuigkeiten" class="xl:col-span-3">
|
||||
<!-- Mobil wischbar, ab sm als Raster -->
|
||||
<div class="-mx-5 flex snap-x scroll-px-5 gap-4 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 sm:pb-0 xl:grid-cols-4 [&::-webkit-scrollbar]:hidden">
|
||||
<NewsCard v-for="post in moreNews.data" :key="post.id" :post="post" class="w-[78%] shrink-0 snap-start sm:w-auto" />
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<Panel v-if="newColleagues.data.length" title="Neu im Team" action-label="Alle Personen" action-href="/personen" class="xl:col-span-3">
|
||||
<ul class="grid gap-3 sm:grid-cols-2 xl:grid-cols-3">
|
||||
<li v-for="person in newColleagues.data" :key="person.id">
|
||||
<Link :href="`/personen/${person.id}`" class="flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-accent">
|
||||
|
|
@ -54,9 +95,16 @@ const profileIncomplete = computed(() => !props.profile.avatar_url || !props.pro
|
|||
</Panel>
|
||||
</div>
|
||||
|
||||
<aside class="grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-4">
|
||||
<aside class="grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-4 xl:col-span-3">
|
||||
<GreetingCard :user="me" :profile="profile" :greeting="greeting" class="hidden lg:block" />
|
||||
|
||||
<Panel title="Termine" class="hidden lg:block" action-label="Alle Termine" action-href="/termine">
|
||||
<div v-if="upcomingEvents.data.length" class="-my-3 divide-y">
|
||||
<EventListItem v-for="event in upcomingEvents.data" :key="event.id" :event="event" />
|
||||
</div>
|
||||
<EmptyState v-else :icon="CalendarDays" title="Keine anstehenden Termine" class="py-6" />
|
||||
</Panel>
|
||||
|
||||
<Link
|
||||
v-if="profileIncomplete"
|
||||
href="/profil/bearbeiten"
|
||||
|
|
|
|||
68
resources/js/pages/Events/Index.vue
Normal file
68
resources/js/pages/Events/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
resources/js/pages/Events/Show.vue
Normal file
66
resources/js/pages/Events/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>
|
||||
59
resources/js/pages/News/Index.vue
Normal file
59
resources/js/pages/News/Index.vue
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<script setup>
|
||||
import { Link, router } from '@inertiajs/vue3';
|
||||
import { ChevronLeft, ChevronRight, Newspaper } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import NewsCard from '@/components/NewsCard.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
defineProps({
|
||||
posts: { type: Object, required: true },
|
||||
categories: { type: Array, required: true },
|
||||
activeCategory: { type: String, default: null },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout title="Neuigkeiten">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Neuigkeiten</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">Aktuelles aus dem Unternehmen und den Bereichen.</p>
|
||||
</div>
|
||||
|
||||
<nav v-if="categories.length" class="mb-6 flex flex-wrap gap-2" aria-label="Kategorien">
|
||||
<Link
|
||||
href="/neuigkeiten"
|
||||
class="rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors"
|
||||
:class="!activeCategory ? 'border-brand bg-brand text-brand-foreground' : 'bg-card hover:bg-accent'"
|
||||
preserve-scroll
|
||||
>
|
||||
Alle
|
||||
</Link>
|
||||
<Link
|
||||
v-for="category in categories"
|
||||
:key="category.slug"
|
||||
:href="`/neuigkeiten?kategorie=${category.slug}`"
|
||||
class="rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors"
|
||||
:class="activeCategory === category.slug ? 'border-brand bg-brand text-brand-foreground' : 'bg-card hover:bg-accent'"
|
||||
preserve-scroll
|
||||
>
|
||||
{{ category.name }}
|
||||
</Link>
|
||||
</nav>
|
||||
|
||||
<div v-if="posts.data.length" class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4">
|
||||
<NewsCard v-for="post in posts.data" :key="post.id" :post="post" />
|
||||
</div>
|
||||
<div v-else class="rounded-lg border border-dashed bg-card">
|
||||
<EmptyState :icon="Newspaper" title="Keine Beiträge" text="In dieser Kategorie ist noch nichts veröffentlicht." />
|
||||
</div>
|
||||
|
||||
<nav v-if="posts.meta.last_page > 1" class="mt-8 flex items-center justify-between" aria-label="Seiten">
|
||||
<p class="text-sm text-muted-foreground">Seite {{ posts.meta.current_page }} von {{ posts.meta.last_page }}</p>
|
||||
<div class="flex gap-2">
|
||||
<Button variant="outline" size="sm" :disabled="!posts.links.prev" @click="router.get(posts.links.prev)"><ChevronLeft /> Neuere</Button>
|
||||
<Button variant="outline" size="sm" :disabled="!posts.links.next" @click="router.get(posts.links.next)">Ältere <ChevronRight /></Button>
|
||||
</div>
|
||||
</nav>
|
||||
</AppLayout>
|
||||
</template>
|
||||
53
resources/js/pages/News/Show.vue
Normal file
53
resources/js/pages/News/Show.vue
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { ArrowLeft, Clock } from '@lucide/vue';
|
||||
import CategoryLabel from '@/components/CategoryLabel.vue';
|
||||
import NewsCard from '@/components/NewsCard.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatDate } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
post: { type: Object, required: true },
|
||||
related: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="post.title">
|
||||
<article class="mx-auto max-w-3xl">
|
||||
<Link href="/neuigkeiten" 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 Neuigkeiten
|
||||
</Link>
|
||||
|
||||
<header>
|
||||
<CategoryLabel :category="post.category" />
|
||||
<h1 class="mt-2 text-3xl leading-tight font-semibold tracking-tight sm:text-[34px]">{{ post.title }}</h1>
|
||||
<p v-if="post.teaser" class="mt-4 text-lg leading-relaxed text-muted-foreground">{{ post.teaser }}</p>
|
||||
|
||||
<div class="mt-6 flex flex-wrap items-center gap-x-6 gap-y-3 border-y py-4 text-sm">
|
||||
<Link v-if="post.author" :href="`/personen/${post.author.id}`" class="flex items-center gap-3 hover:underline">
|
||||
<PersonAvatar :person="post.author" class="size-9" />
|
||||
<span>
|
||||
<span class="block font-medium">{{ post.author.name }}</span>
|
||||
<span v-if="post.author.job_title" class="block text-xs text-muted-foreground">{{ post.author.job_title }}</span>
|
||||
</span>
|
||||
</Link>
|
||||
<span class="text-muted-foreground">{{ formatDate(post.published_at) }}</span>
|
||||
<span class="inline-flex items-center gap-1.5 text-muted-foreground"><Clock class="size-4" /> {{ post.reading_minutes }} Min. Lesezeit</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<img v-if="post.cover_url" :src="post.cover_url" :alt="post.title" class="mt-8 aspect-video w-full rounded-lg object-cover" />
|
||||
|
||||
<div class="prose prose-neutral mt-8 max-w-none prose-headings:tracking-tight prose-img:rounded-lg" v-html="post.body_html" />
|
||||
</article>
|
||||
|
||||
<section v-if="related.data.length" class="mx-auto mt-16 max-w-5xl">
|
||||
<h2 class="mb-4 text-lg font-semibold">Weitere Beiträge</h2>
|
||||
<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<NewsCard v-for="item in related.data" :key="item.id" :post="item" />
|
||||
</div>
|
||||
</section>
|
||||
</AppLayout>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue