Vorlesen und Leichte Sprache mit KI-Vorschlag (0.34.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 9m24s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 9m15s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 9m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 9m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m5s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m10s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m8s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m23s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 13:24:56 +00:00
parent fc2505297b
commit 856a5c30af
210 changed files with 1447 additions and 521 deletions

View file

@ -4,6 +4,7 @@ import { Link, router } from '@inertiajs/vue3';
import { useWindowScroll } from '@vueuse/core';
import { ArrowLeft, CalendarDays, ChartNoAxesColumn, Check, Clock, Heart, Link2, Mail, MessageCircle, PenLine } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import EasyLanguageBar from '@/components/EasyLanguageBar.vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
import NewsComments from '../components/NewsComments.vue';
import AppLayout from '@/layouts/AppLayout.vue';
@ -18,8 +19,12 @@ const props = defineProps({
content: { type: Object, default: null },
comments: { type: Object, default: null },
reach: { type: Object, default: null },
easy: { type: Object, default: null },
});
const showEasy = ref(false);
const body = ref(null);
// Herz: sofort umschalten, der Server bestätigt im Hintergrund
const liked = ref(!!props.post.liked);
const likes = ref(props.post.likes ?? 0);
@ -125,13 +130,19 @@ const mailLink = () => `mailto:?subject=${encodeURIComponent(props.post.title)}&
</div>
</div>
<EasyLanguageBar v-model="showEasy" :easy="easy" :read-source="() => `${post.title}.\n${post.teaser ?? ''}\n${body?.innerText ?? ''}`" class="-mt-2 mb-6" />
<div ref="body">
<!-- Leichte Sprache -->
<div v-if="showEasy && easy?.html" class="prose prose-neutral max-w-none text-[17px] leading-relaxed prose-headings:tracking-tight dark:prose-invert" lang="de" v-html="easy.html" />
<!-- Mit dem Baukasten geschrieben: Blöcke wie auf Seiten -->
<PageContent v-if="content" :content="content" />
<PageContent v-else-if="content" :content="content" />
<div
v-else
class="prose prose-neutral max-w-none prose-headings:tracking-tight prose-h2:mt-10 prose-a:text-brand-text prose-blockquote:border-l-brand prose-blockquote:bg-brand-soft/50 prose-blockquote:py-1 prose-blockquote:not-italic prose-img:rounded-lg dark:prose-invert first-of-type:prose-p:text-lg"
v-html="post.body_html"
/>
</div>
<!-- Eingebundenes Formular (Pagebuilder-Block des Formular-Plugins) -->
<PageContent v-if="form" :content="form" class="mt-10" />

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\News\Http\Controllers;
use App\Accessibility\EasyLanguage;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Pagebuilder\Content;
@ -79,6 +80,7 @@ class NewsController extends Controller
] : null,
],
'editUrl' => $canEdit ? route('news.editor.edit', $post) : null,
'easy' => app(EasyLanguage::class)->props('news', $post->id, $user, $canEdit),
// Reichweite und wer ein Herz gegeben hat: nur für die Redaktion der Kategorie
'reach' => $canEdit ? [
...app(Reach::class)->stats($post),

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\News;
use App\Accessibility\EasyLanguage;
use App\Dashboard\Widgets;
use App\Editorial\Editorial;
use App\Media\ImagePaths;
@ -9,6 +10,7 @@ use App\Media\MediaUsages;
use App\Models\User;
use App\Pagebuilder\Blocks;
use App\Pagebuilder\BlockType;
use App\Pagebuilder\Content;
use App\Pagebuilder\Field;
use App\Plugins\Plugin;
use App\Profile\ProfilePanels;
@ -31,6 +33,19 @@ class NewsPlugin extends Plugin
{
public function register(): void
{
// Leichte Sprache als zweite Fassung von Beiträgen
$this->app->make(EasyLanguage::class)->register('news', function (int $id, User $user) {
$post = NewsPost::query()->find($id);
return $post ? [
'can_view' => $post->isPublished() && $post->isVisibleTo($user),
'can_edit' => $user->can('update', $post),
'title' => $post->title,
'text' => fn () => trim($post->teaser."\n\n".app(Content::class)->plainText($post->blocks(), publicOnly: true)),
] : null;
});
NewsPost::deleted(fn (NewsPost $post) => app(EasyLanguage::class)->forget('news', $post->id));
$this->app->make(GlobalSearch::class)->add('news', 'Neuigkeiten', 'newspaper', fn (...$args) => app(NewsSearch::class)(...$args), sort: 10);
$this->app->make(Navigation::class)->add('news', 'Neuigkeiten', '/neuigkeiten', active: ['news.index', 'news.show'], sort: 20);