Kommentare mit Antworten unter Neuigkeiten
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 8m0s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 8m6s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m10s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m19s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m21s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 20:13:41 +00:00
parent f3f2d23961
commit 9320d602a8
117 changed files with 1015 additions and 423 deletions

View file

@ -74,6 +74,7 @@ const form = useForm({
is_featured: props.post?.is_featured ?? false,
published_at: localValue(props.post?.published_at),
form_id: props.post?.form_id ?? null,
comments_enabled: props.post?.comments_enabled ?? true,
action: 'draft',
});
@ -607,6 +608,11 @@ function autoGrow(event) {
In dieser Kategorie veröffentlicht die Redaktion. Reichen Sie den Beitrag zur Freigabe ein, wenn er fertig ist.
</p>
<label class="flex items-center justify-between gap-3 text-[13px] font-medium">
Kommentare erlauben
<Switch v-model="form.comments_enabled" />
</label>
<FormField v-if="forms.length" id="form_id" label="Formular unter dem Beitrag" :error="form.errors.form_id" hint="Z. B. Anmeldung oder Rückmeldung zum Beitrag.">
<NativeSelect id="form_id" v-model="form.form_id" :options="forms" placeholder="– kein Formular –" />
</FormField>

View file

@ -2,9 +2,10 @@
import { ref, watch } from 'vue';
import { Link } from '@inertiajs/vue3';
import { useWindowScroll } from '@vueuse/core';
import { ArrowLeft, CalendarDays, Check, Clock, Link2, Mail, PenLine } from '@lucide/vue';
import { ArrowLeft, CalendarDays, Check, Clock, Link2, Mail, MessageCircle, PenLine } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import PersonAvatar from '@/components/PersonAvatar.vue';
import NewsComments from '../components/NewsComments.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import PageContent from '@/pagebuilder/PageContent.vue';
import { formatDate, formatShortDate } from '@/lib/format';
@ -15,6 +16,7 @@ const props = defineProps({
editUrl: { type: String, default: null },
form: { type: Object, default: null },
content: { type: Object, default: null },
comments: { type: Object, default: null },
});
// Lesefortschritt: Anteil des Artikels, der schon oben aus dem Bild gescrollt ist
@ -78,13 +80,15 @@ const mailLink = () => `mailto:?subject=${encodeURIComponent(props.post.title)}&
<div class="mt-2 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80">
<span class="inline-flex items-center gap-1.5"><CalendarDays class="size-4" /> {{ formatDate(post.published_at) }}</span>
<span class="inline-flex items-center gap-1.5"><Clock class="size-4" /> {{ post.reading_minutes }} Min. Lesezeit</span>
<a v-if="comments?.count" href="#kommentare" class="inline-flex items-center gap-1.5 hover:text-white"><MessageCircle class="size-4" /> {{ comments.count }} {{ comments.count === 1 ? 'Kommentar' : 'Kommentare' }}</a>
</div>
</div>
</header>
<div class="mt-6 grid gap-6 lg:grid-cols-12">
<!-- Inhalt in einer weißen Karte -->
<article ref="article" class="min-w-0 rounded-xl border bg-card p-6 shadow-xs sm:p-10 lg:col-span-8">
<div class="grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8">
<article ref="article" class="min-w-0 rounded-xl border bg-card p-6 shadow-xs sm:p-10">
<!-- Am Handy steht die Seitenleiste unten – dort den Autor gleich oben zeigen -->
<div v-if="post.author" class="mb-8 flex items-center gap-3 border-b pb-6 lg:hidden">
<PersonAvatar :person="post.author" class="size-11" />
@ -114,6 +118,9 @@ const mailLink = () => `mailto:?subject=${encodeURIComponent(props.post.title)}&
</footer>
</article>
<NewsComments v-if="comments" :post-slug="post.slug" :comments="comments" />
</div>
<aside class="grid content-start gap-6 lg:col-span-4">
<section v-if="post.author" class="rounded-xl border bg-card p-5 shadow-xs">
<h2 class="mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase">Geschrieben von</h2>