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

@ -1,7 +1,9 @@
<script setup>
import { ref } from 'vue';
import { Link } from '@inertiajs/vue3';
import { ChevronRight, CalendarClock, PencilLine } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import EasyLanguageBar from '@/components/EasyLanguageBar.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import PageContent from '@/pagebuilder/PageContent.vue';
import { formatDate } from '@/lib/format';
@ -13,8 +15,12 @@ const props = defineProps({
breadcrumbs: { type: Array, default: () => [] },
section: { type: Object, required: true },
editor: { type: Object, default: null },
easy: { type: Object, default: null },
});
const showEasy = ref(false);
const body = ref(null);
const hasSectionNav = props.section.children.length > 0;
</script>
@ -64,7 +70,12 @@ const hasSectionNav = props.section.children.length > 0;
</p>
</div>
<PageContent :content="content" />
<EasyLanguageBar v-if="content.blocks.length" v-model="showEasy" :easy="easy" :read-source="() => `${page.title}.\n${body?.innerText ?? ''}`" class="-mt-4 mb-6" />
<div ref="body">
<div v-if="showEasy && easy?.html" class="prose prose-neutral max-w-3xl text-[17px] leading-relaxed prose-headings:tracking-tight dark:prose-invert" v-html="easy.html" />
<PageContent v-else :content="content" />
</div>
<p v-if="!content.blocks.length" class="rounded-lg border border-dashed px-6 py-12 text-center text-sm text-muted-foreground">Diese Seite hat noch keinen Inhalt.</p>
</article>
</div>

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\Pages\Http\Controllers;
use App\Accessibility\EasyLanguage;
use App\Http\Controllers\Controller;
use App\Pagebuilder\Content;
use Illuminate\Http\Request;
@ -51,6 +52,7 @@ class PageController extends Controller
'active' => $root === $page->id,
'children' => $tree->visibleTree($root, $user),
],
'easy' => app(EasyLanguage::class)->props('pages', $page->id, $user, $canEdit),
'editor' => $canEdit ? [
'url' => route('pages.editor', $page),
'has_draft' => $page->hasDraft(),

View file

@ -2,12 +2,14 @@
namespace Inhaus\Plugins\Pages;
use App\Accessibility\EasyLanguage;
use App\Editorial\Editorial;
use App\Media\ImagePaths;
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\Search\GlobalSearch;
@ -29,6 +31,19 @@ class PagesPlugin extends Plugin
$this->app->singleton(PageTree::class);
// Leichte Sprache als zweite Fassung von Seiten
$this->app->make(EasyLanguage::class)->register('pages', function (int $id, User $user) {
$page = Page::query()->find($id);
return $page ? [
'can_view' => $page->isPublished() && app(PageTree::class)->isVisible($page->id, $user),
'can_edit' => $user->can('update', $page),
'title' => $page->title,
'text' => fn () => app(Content::class)->plainText($page->content, publicOnly: true),
] : null;
});
Page::deleted(fn (Page $page) => app(EasyLanguage::class)->forget('pages', $page->id));
$abilities = $this->app->make(Abilities::class);
$abilities->define('pages.manage', 'Seiten: alle Seiten verwalten', 'Seiten');
$abilities->define('pages.edit', 'Seiten bearbeiten', 'Seiten', resource: 'page', portal: true);