Merge pull request 'cms und widget + neue symbole' (#18) from develop into main
Reviewed-on: #18
No files matched your search
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Domain\Cms\Sections\PageSections;
|
||||
|
||||
/**
|
||||
* Interne Linkziele für die Auswahl im CMS: Seiten mit ihrem Veröffentlichungszustand und die Sprungmarken ihrer
|
||||
* Abschnitte. Rein lesend; das Ergebnis ist eine Adresse, die in ein Linkfeld oder einen Menüeintrag geschrieben wird.
|
||||
*
|
||||
* Adressformen: „/pfad“, „/pfad#marke“ (andere Seite) und „#marke“ (dieselbe Seite). Sie bestehen SafeUrl.
|
||||
*/
|
||||
class LinkTargets
|
||||
{
|
||||
public function __construct(private readonly PageSections $sections) {}
|
||||
|
||||
/**
|
||||
* Seiten für die Auswahl, nach Adresse sortiert. Suche in Titel und Adresse.
|
||||
*
|
||||
* @return list<array{id: int, titel: string, pfad: string, zustand: array{label: string, ton: string}, marken: int}>
|
||||
*/
|
||||
public function pages(string $search = '', ?int $exceptId = null): array
|
||||
{
|
||||
$needle = mb_strtolower(trim($search));
|
||||
|
||||
return Page::query()->with(['latestRevision', 'publishedRevision'])->orderBy('path')->get()
|
||||
->reject(fn (Page $page): bool => $page->getKey() === $exceptId)
|
||||
->map(fn (Page $page): array => [
|
||||
'id' => (int) $page->getKey(),
|
||||
'titel' => $page->latestRevision?->contentTitle() ?: $page->path,
|
||||
'pfad' => $page->path,
|
||||
'zustand' => $this->state($page),
|
||||
'marken' => count($this->anchorsOf($page->latestRevision?->sections() ?? [])),
|
||||
])
|
||||
->filter(fn (array $page): bool => $needle === '' || str_contains(mb_strtolower($page['titel'].' '.$page['pfad']), $needle))
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{label: string, ton: string}
|
||||
*/
|
||||
public function state(Page $page): array
|
||||
{
|
||||
if ($page->published_revision_id === null) {
|
||||
return ['label' => 'Nur Entwurf, öffentlich nicht erreichbar', 'ton' => 'offen'];
|
||||
}
|
||||
|
||||
return $page->latestRevision !== null && $page->latestRevision->id !== $page->published_revision_id
|
||||
? ['label' => 'Veröffentlicht · Entwurf neuer', 'ton' => 'gut']
|
||||
: ['label' => 'Veröffentlicht', 'ton' => 'gut'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sprungmarken einer gespeicherten Seite: die des neuesten Entwurfs, je mit dem Hinweis, ob sie schon
|
||||
* veröffentlicht sind und ob der Abschnitt ausgeblendet ist.
|
||||
*
|
||||
* @return list<array{anchor: string, label: string, hidden: bool, published: bool}>
|
||||
*/
|
||||
public function anchorsForPage(Page $page): array
|
||||
{
|
||||
$published = collect($this->anchorsOf($page->publishedRevision?->sections() ?? []))
|
||||
->filter(fn (array $anchor): bool => ! $anchor['hidden'])
|
||||
->pluck('anchor')
|
||||
->all();
|
||||
|
||||
return array_map(
|
||||
fn (array $anchor): array => $anchor + ['published' => in_array($anchor['anchor'], $published, true)],
|
||||
$this->anchorsOf($page->latestRevision?->sections() ?? $page->publishedRevision?->sections() ?? []),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sprungmarken der Abschnitte im Editor, auch ungespeicherte. Für „diese Seite“.
|
||||
*
|
||||
* @param list<array<string, mixed>> $sections Abschnitte im Modell (nach SectionEditor::fromEditorState)
|
||||
* @return list<array{anchor: string, label: string, hidden: bool, published: bool}>
|
||||
*/
|
||||
public function anchorsInEditor(array $sections): array
|
||||
{
|
||||
return array_map(fn (array $anchor): array => $anchor + ['published' => false], $this->anchorsOf($sections));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string, mixed>> $sections
|
||||
* @return list<array{anchor: string, label: string, hidden: bool}>
|
||||
*/
|
||||
public function anchorsOf(array $sections): array
|
||||
{
|
||||
$anchors = [];
|
||||
|
||||
foreach (array_values($sections) as $position => $section) {
|
||||
$anchor = PageSections::cleanAnchor($section['anchor'] ?? null);
|
||||
|
||||
if ($anchor === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = PageSections::cleanName($section['name'] ?? null);
|
||||
$anchors[] = [
|
||||
'anchor' => $anchor,
|
||||
'label' => $name ?? 'Abschnitt '.($position + 1),
|
||||
'hidden' => PageSections::isHidden($section['hidden'] ?? false),
|
||||
];
|
||||
}
|
||||
|
||||
return $anchors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adresse für ein Linkfeld: „/pfad“, „/pfad#marke“ oder (dieselbe Seite) „#marke“.
|
||||
*/
|
||||
public function href(?string $path, ?string $anchor): ?string
|
||||
{
|
||||
$anchor = $anchor !== null && $anchor !== '' ? PageSections::cleanAnchor($anchor) : null;
|
||||
|
||||
if ($path === null) {
|
||||
return $anchor !== null ? '#'.$anchor : null;
|
||||
}
|
||||
|
||||
return $path.($anchor !== null ? '#'.$anchor : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Vollständige öffentliche Adresse mit Sprungmarke, für Verweise von außen.
|
||||
*/
|
||||
public function publicUrl(Page $page, ?string $anchor = null): string
|
||||
{
|
||||
return $page->publicUrl().($anchor !== null && $anchor !== '' ? '#'.$anchor : '');
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Domain\Cms\Sections\PageSections;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use App\Domain\Commerce\Shop;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -32,6 +33,7 @@ class NavigationItem extends Model
|
||||
'label',
|
||||
'page_id',
|
||||
'url',
|
||||
'anchor',
|
||||
'placement',
|
||||
'sort_order',
|
||||
'is_visible',
|
||||
@@ -86,7 +88,9 @@ public function href(): ?string
|
||||
}
|
||||
|
||||
if ($this->page !== null) {
|
||||
return $this->page->path === '/' ? url('/') : url($this->page->path);
|
||||
$anchor = PageSections::cleanAnchor($this->anchor);
|
||||
|
||||
return ($this->page->path === '/' ? url('/') : url($this->page->path)).($anchor !== null ? '#'.$anchor : '');
|
||||
}
|
||||
|
||||
if ($this->url === null || $this->url === '' || ! SafeUrl::isSafe($this->url)) {
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
* Version 2 (Abstände): oben, unten und Widget-Abstand sind drei unabhängige Werte. Hüllen der Version 1 werden beim
|
||||
* Lesen übersetzt (SectionStyle::migrateSpacing), ohne die Darstellung zu ändern; gespeicherte Revisionen bleiben.
|
||||
*
|
||||
* Optionale Felder des Abschnitts (abwärtskompatibel, fehlen in älteren Revisionen):
|
||||
* - name: interner Name zur Orientierung im Seitenaufbau (nie öffentlich), höchstens 80 Zeichen;
|
||||
* - anchor: Sprungmarke, wird als Element-Kennung des Abschnitts ausgegeben (Link „#marke“ oder „/pfad#marke“),
|
||||
* je Seite eindeutig, nur Kleinbuchstaben, Ziffern und Bindestriche;
|
||||
* - hidden: true blendet den Abschnitt auf der Website aus; er bleibt im Entwurf und in den Revisionen erhalten.
|
||||
* Ältere Programmstände kennen „hidden“ nicht und würden einen ausgeblendeten Abschnitt zeigen (siehe Release-Vorbereitung).
|
||||
*
|
||||
* Jeder Slot enthält höchstens ein Widget aus dem zentralen Widget-Register. Abschnitte sind nicht verschachtelbar.
|
||||
* Revisionen ohne Abschnitte (Bestand vor dieser Fassung) werden beim Lesen als einspaltige Abschnitte gelesen.
|
||||
*/
|
||||
@@ -29,6 +36,20 @@ class PageSections
|
||||
|
||||
public const MAX_WIDGETS = 60;
|
||||
|
||||
public const MAX_NAME = 80;
|
||||
|
||||
public const MAX_ANCHOR = 60;
|
||||
|
||||
/**
|
||||
* Kennungen, die im Seitengerüst schon vergeben sind (Hauptbereich, Navigation, Fuß) oder als Vorgabe dienen.
|
||||
* Eine Sprungmarke darf sie nicht wiederholen.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
public const RESERVED_ANCHORS = ['inhalt', 'main', 'top', 'site-nav', 'fuss-themen', 'mb-account-menu'];
|
||||
|
||||
public const ANCHOR_PATTERN = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/';
|
||||
|
||||
public function __construct(private readonly WidgetRegistry $widgets) {}
|
||||
|
||||
/**
|
||||
@@ -36,7 +57,7 @@ public function __construct(private readonly WidgetRegistry $widgets) {}
|
||||
*
|
||||
* @param array<int|string, mixed>|null $sections gespeicherte Abschnitte (Spalte sections)
|
||||
* @param array<int|string, mixed>|null $blocks flache Bausteinliste (Spalte blocks), nur ohne Abschnitte verwendet
|
||||
* @return list<array{id: ?string, v: int, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
* @return list<array{id: ?string, v: int, name: ?string, anchor: ?string, hidden: bool, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
*/
|
||||
public function read(?array $sections, ?array $blocks = null): array
|
||||
{
|
||||
@@ -59,7 +80,7 @@ public function read(?array $sections, ?array $blocks = null): array
|
||||
* „sections.N.layout“, „sections.N.style.image“, „sections.N.slots“, „sections.N.slots.M.data.feld“.
|
||||
*
|
||||
* @param array<int|string, mixed> $content
|
||||
* @return list<array{id: string, v: int, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
* @return list<array{id: string, v: int, name: ?string, anchor: ?string, hidden: bool, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
*/
|
||||
public function normalize(array $content): array
|
||||
{
|
||||
@@ -75,6 +96,7 @@ public function normalize(array $content): array
|
||||
$sections = [];
|
||||
$seenSectionIds = [];
|
||||
$seenWidgetIds = [];
|
||||
$seenAnchors = [];
|
||||
$widgetCount = 0;
|
||||
|
||||
// Eingaben mit Abständen der Version 1 (zum Beispiel ältere Aufrufer) werden wie beim Lesen übersetzt.
|
||||
@@ -96,7 +118,7 @@ public function normalize(array $content): array
|
||||
$item['style'] = $migrated[$index]['style'] ?? ($item['style'] ?? []);
|
||||
}
|
||||
|
||||
$sections[] = $this->normalizeSection($item, $index, $errors, $seenSectionIds, $seenWidgetIds, $widgetCount);
|
||||
$sections[] = $this->normalizeSection($item, $index, $errors, $seenSectionIds, $seenWidgetIds, $widgetCount, $seenAnchors);
|
||||
}
|
||||
|
||||
if ($widgetCount > self::MAX_WIDGETS) {
|
||||
@@ -164,12 +186,14 @@ public function mediaPaths(array $sections): array
|
||||
*/
|
||||
public function pageTitle(array $sections): ?string
|
||||
{
|
||||
return $this->widgets->pageTitle($this->flatten($sections));
|
||||
// Ein ausgeblendeter Abschnitt liefert keinen Seitentitel; seine Medien bleiben dagegen erfasst (mediaPaths),
|
||||
// damit ihre Bilder nicht als ungenutzt gelten.
|
||||
return $this->widgets->pageTitle($this->flatten(array_values(array_filter($sections, fn (array $section): bool => ! ($section['hidden'] ?? false)))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int|string, mixed> $blocks
|
||||
* @return list<array{id: ?string, v: int, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
* @return list<array{id: ?string, v: int, name: ?string, anchor: ?string, hidden: bool, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}>
|
||||
*/
|
||||
private function wrapWidgets(array $blocks): array
|
||||
{
|
||||
@@ -179,6 +203,9 @@ private function wrapWidgets(array $blocks): array
|
||||
$sections[] = [
|
||||
'id' => null,
|
||||
'v' => self::VERSION,
|
||||
'name' => null,
|
||||
'anchor' => null,
|
||||
'hidden' => false,
|
||||
'layout' => SectionLayouts::DEFAULT,
|
||||
// Bestand vor dem Raster stand in einem durchgehenden Blatt: kompakte Abstände, zwischen den Widgets
|
||||
// nur einmal (oben kein Abstand ab dem zweiten), wie bisher.
|
||||
@@ -192,7 +219,7 @@ private function wrapWidgets(array $blocks): array
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $section
|
||||
* @return array{id: ?string, v: int, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}
|
||||
* @return array{id: ?string, v: int, name: ?string, anchor: ?string, hidden: bool, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}
|
||||
*/
|
||||
private function upcastSection(array $section): array
|
||||
{
|
||||
@@ -210,6 +237,9 @@ private function upcastSection(array $section): array
|
||||
return [
|
||||
'id' => is_string($section['id'] ?? null) ? $section['id'] : null,
|
||||
'v' => self::VERSION,
|
||||
'name' => self::cleanName($section['name'] ?? null),
|
||||
'anchor' => self::cleanAnchor($section['anchor'] ?? null),
|
||||
'hidden' => self::isHidden($section['hidden'] ?? false),
|
||||
'layout' => $layout,
|
||||
'style' => SectionStyle::fromStored($section['style'] ?? []),
|
||||
'slots' => $slots,
|
||||
@@ -221,9 +251,9 @@ private function upcastSection(array $section): array
|
||||
* @param array<string, list<string>> $errors
|
||||
* @param array<string, true> $seenSectionIds
|
||||
* @param array<string, true> $seenWidgetIds
|
||||
* @return array{id: string, v: int, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}
|
||||
* @return array{id: string, v: int, name: ?string, anchor: ?string, hidden: bool, layout: string, style: array<string, mixed>, slots: list<array<string, mixed>|null>}
|
||||
*/
|
||||
private function normalizeSection(array $section, int $index, array &$errors, array &$seenSectionIds, array &$seenWidgetIds, int &$widgetCount): array
|
||||
private function normalizeSection(array $section, int $index, array &$errors, array &$seenSectionIds, array &$seenWidgetIds, int &$widgetCount, array &$seenAnchors): array
|
||||
{
|
||||
$prefix = "sections.$index";
|
||||
|
||||
@@ -294,15 +324,90 @@ private function normalizeSection(array $section, int $index, array &$errors, ar
|
||||
}
|
||||
$seenSectionIds[$id] = true;
|
||||
|
||||
[$name, $anchor] = $this->normalizeLabels($section, $prefix, $errors, $seenAnchors);
|
||||
|
||||
return [
|
||||
'id' => $id,
|
||||
'v' => self::VERSION,
|
||||
'name' => $name,
|
||||
'anchor' => $anchor,
|
||||
'hidden' => self::isHidden($section['hidden'] ?? false),
|
||||
'layout' => $layout,
|
||||
'style' => $style,
|
||||
'slots' => $slots,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Name und Sprungmarke eines Abschnitts. Fehler: „sections.N.name“ und „sections.N.anchor“.
|
||||
*
|
||||
* @param array<string, mixed> $section
|
||||
* @param array<string, list<string>> $errors
|
||||
* @param array<string, true> $seenAnchors
|
||||
* @return array{0: ?string, 1: ?string}
|
||||
*/
|
||||
private function normalizeLabels(array $section, string $prefix, array &$errors, array &$seenAnchors): array
|
||||
{
|
||||
$name = null;
|
||||
$rawName = $section['name'] ?? null;
|
||||
|
||||
if (is_string($rawName) && trim($rawName) !== '') {
|
||||
$name = self::cleanName($rawName);
|
||||
|
||||
if ($name === null) {
|
||||
$errors["$prefix.name"] = ['Der Name darf höchstens '.self::MAX_NAME.' Zeichen lang sein.'];
|
||||
}
|
||||
}
|
||||
|
||||
$anchor = null;
|
||||
$rawAnchor = $section['anchor'] ?? null;
|
||||
|
||||
if (is_string($rawAnchor) && trim($rawAnchor) !== '') {
|
||||
$candidate = mb_strtolower(trim($rawAnchor));
|
||||
|
||||
if (strlen($candidate) > self::MAX_ANCHOR || preg_match(self::ANCHOR_PATTERN, $candidate) !== 1) {
|
||||
$errors["$prefix.anchor"] = ['Eine Sprungmarke besteht aus Kleinbuchstaben, Ziffern und einzelnen Bindestrichen (höchstens '.self::MAX_ANCHOR.' Zeichen), zum Beispiel „anmeldung“.'];
|
||||
} elseif (in_array($candidate, self::RESERVED_ANCHORS, true) || str_starts_with($candidate, 'bereich-')) {
|
||||
$errors["$prefix.anchor"] = ['Diese Sprungmarke ist im Seitengerüst schon vergeben. Bitte eine andere wählen.'];
|
||||
} elseif (isset($seenAnchors[$candidate])) {
|
||||
$errors["$prefix.anchor"] = ['Diese Sprungmarke gibt es auf der Seite schon. Jede Sprungmarke darf nur einmal vorkommen.'];
|
||||
} else {
|
||||
$seenAnchors[$candidate] = true;
|
||||
$anchor = $candidate;
|
||||
}
|
||||
} elseif ($rawAnchor !== null && ! is_string($rawAnchor)) {
|
||||
$errors["$prefix.anchor"] = ['Die Sprungmarke ist ungültig.'];
|
||||
}
|
||||
|
||||
return [$name, $anchor];
|
||||
}
|
||||
|
||||
/** Interner Name: Leerraum vereinheitlicht, ohne Steuerzeichen; leer oder über 80 Zeichen ergibt null. */
|
||||
public static function cleanName(mixed $value): ?string
|
||||
{
|
||||
if (! is_string($value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$name = trim((string) preg_replace('/\s+/u', ' ', (string) preg_replace('/[\x00-\x1F\x7F]/u', ' ', $value)));
|
||||
|
||||
return $name === '' || mb_strlen($name) > self::MAX_NAME ? null : $name;
|
||||
}
|
||||
|
||||
/** Lesepfad: eine gespeicherte Sprungmarke nur, wenn sie der Form entspricht. */
|
||||
public static function cleanAnchor(mixed $value): ?string
|
||||
{
|
||||
return is_string($value) && strlen($value) <= self::MAX_ANCHOR && preg_match(self::ANCHOR_PATTERN, $value) === 1
|
||||
&& ! in_array($value, self::RESERVED_ANCHORS, true) && ! str_starts_with($value, 'bereich-')
|
||||
? $value
|
||||
: null;
|
||||
}
|
||||
|
||||
public static function isHidden(mixed $value): bool
|
||||
{
|
||||
return $value === true || $value === 1 || $value === '1' || $value === 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $style
|
||||
* @param array<string, list<string>> $errors
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
* - Ein Abschnitt ohne darstellbares Widget entfällt samt Hintergrund und Trenner.
|
||||
* - Das erste dargestellte Widget der Seite ist der Seiteneinstieg (Überschrift erster Ordnung).
|
||||
* - Trenner stehen zwischen Abschnitten, nie nach dem letzten.
|
||||
* - Ein ausgeblendeter Abschnitt („hidden“) erscheint nie auf der Website und zählt weder für das erste Widget noch für
|
||||
* Trenner. Nur die Vorschau zeigt an seiner Stelle einen schmalen Hinweis (ohne Inhalt).
|
||||
* - Eine Sprungmarke („anchor“) ist die Element-Kennung des Abschnitts; ohne Sprungmarke gilt „bereich-<Kennung>“.
|
||||
*/
|
||||
class SectionRenderer
|
||||
{
|
||||
@@ -31,6 +34,14 @@ public function renderAll(array $sections, RenderContext $context): HtmlString
|
||||
$first = true;
|
||||
|
||||
foreach ($sections as $section) {
|
||||
if ($section['hidden'] ?? false) {
|
||||
if ($context->preview) {
|
||||
$rendered[] = ['note' => $this->hiddenNote($section)];
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$cells = [];
|
||||
$shown = false;
|
||||
$units = SectionLayouts::units($section['layout']);
|
||||
@@ -54,13 +65,28 @@ public function renderAll(array $sections, RenderContext $context): HtmlString
|
||||
}
|
||||
|
||||
$html = '';
|
||||
$last = count($rendered) - 1;
|
||||
$last = -1;
|
||||
|
||||
foreach ($rendered as $position => $item) {
|
||||
if (isset($item['section'])) {
|
||||
$last = $position;
|
||||
}
|
||||
}
|
||||
|
||||
$index = 0;
|
||||
|
||||
foreach ($rendered as $position => $item) {
|
||||
if (! isset($item['section'])) {
|
||||
$html .= $item['note'];
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($rendered as $index => $item) {
|
||||
$html .= $this->renderSection($item['section'], $item['cells'], $index, $context);
|
||||
$index++;
|
||||
|
||||
$divider = $item['section']['style']['divider'] ?? 'none';
|
||||
if ($index < $last && in_array($divider, ['line', 'accent'], true)) {
|
||||
if ($position < $last && in_array($divider, ['line', 'accent'], true)) {
|
||||
$html .= '<div class="section-divider section-divider-'.$divider.'" aria-hidden="true"><span></span></div>';
|
||||
}
|
||||
}
|
||||
@@ -68,6 +94,18 @@ public function renderAll(array $sections, RenderContext $context): HtmlString
|
||||
return new HtmlString($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hinweis der Vorschau an der Stelle eines ausgeblendeten Abschnitts.
|
||||
*
|
||||
* @param array<string, mixed> $section
|
||||
*/
|
||||
private function hiddenNote(array $section): string
|
||||
{
|
||||
$name = is_string($section['name'] ?? null) && $section['name'] !== '' ? '„'.$section['name'].'“ ' : '';
|
||||
|
||||
return '<div class="section-hidden-note" role="note">Abschnitt '.e($name).'ist für die Website ausgeblendet und erscheint hier nur als Hinweis.</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $section
|
||||
* @param list<array{units: int, html: string}> $cells alle Plätze des Rasters in ihrer Reihenfolge; html '' = leer
|
||||
@@ -106,7 +144,11 @@ private function renderSection(array $section, array $cells, int $index, RenderC
|
||||
$classes[] = $scope;
|
||||
}
|
||||
|
||||
$id = is_string($section['id'] ?? null) ? ' id="bereich-'.e($section['id']).'"' : '';
|
||||
// Die Sprungmarke ist die Kennung, die ein Link „#marke“ anspringt; ohne sie bleibt die bisherige Kennung.
|
||||
$anchor = PageSections::cleanAnchor($section['anchor'] ?? null);
|
||||
$id = $anchor !== null
|
||||
? ' id="'.e($anchor).'"'
|
||||
: (is_string($section['id'] ?? null) ? ' id="bereich-'.e($section['id']).'"' : '');
|
||||
$html = '<div class="'.e(implode(' ', $classes)).'"'.$id.'>';
|
||||
|
||||
if ($hasImage) {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms\Widgets\Support;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
/**
|
||||
* Linkfeld für alle Widgets: Die Adresse lässt sich frei eintippen (Seitenpfad, #Sprungmarke oder http(s)-Adresse) oder
|
||||
* über den Dialog „Interne Seite oder Sprungmarke wählen“ aus den Seiten der Website übernehmen
|
||||
* (ChoosesLinkTargets). Der Knopf ruft den Dialog direkt auf; ein Aktionsdialog im Bausteindialog entsteht nicht. Wo die
|
||||
* Seite den Dialog nicht kennt, fehlt der Knopf und das Feld bleibt ein Textfeld.
|
||||
*/
|
||||
final class LinkField
|
||||
{
|
||||
public static function make(string $name, string $label = 'Linkziel'): TextInput
|
||||
{
|
||||
return TextInput::make($name)
|
||||
->label($label)
|
||||
->maxLength(500)
|
||||
->rule(SafeUrl::rule())
|
||||
->suffixAction(Action::make('linkWaehlen')
|
||||
->label('Interne Seite oder Sprungmarke wählen')
|
||||
->tooltip('Interne Seite oder Sprungmarke wählen')
|
||||
->icon('heroicon-o-link')
|
||||
->visible(fn ($livewire): bool => is_object($livewire) && method_exists($livewire, 'openLinkPicker'))
|
||||
->actionJs(fn ($component): string => '$wire.openLinkPicker('.Js::from($component->getStatePath()).')'));
|
||||
}
|
||||
}
|
||||
@@ -53,10 +53,7 @@ public static function eyebrowField(): TextInput
|
||||
|
||||
public static function ctaFields(): Grid
|
||||
{
|
||||
$url = fn (string $name, string $label, string $pair) => TextInput::make($name)
|
||||
->label($label)
|
||||
->maxLength(500)
|
||||
->rule(SafeUrl::rule())
|
||||
$url = fn (string $name, string $label, string $pair) => LinkField::make($name, $label)
|
||||
->requiredWith($pair)
|
||||
->live(onBlur: true)
|
||||
->placeholder('/programme');
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
final class RichText
|
||||
{
|
||||
/** Werkzeugleiste des Editors; muss zur Erlaubnisliste unten passen. */
|
||||
public const TOOLBAR = [['bold', 'italic', 'link'], ['bulletList', 'orderedList'], ['undo', 'redo']];
|
||||
public const TOOLBAR = [['bold', 'italic', 'link', 'interneSeite'], ['bulletList', 'orderedList'], ['undo', 'redo']];
|
||||
|
||||
private static ?HtmlSanitizer $sanitizer = null;
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
|
||||
/**
|
||||
* Zulässige Linkziele in redaktionellen Inhalten: Seitenpfade ("/...") oder http(s)-Adressen.
|
||||
* Zulässige Linkziele in redaktionellen Inhalten: Seitenpfade ("/...", auch mit "#marke"), Sprungmarken auf der
|
||||
* eigenen Seite ("#marke") oder http(s)-Adressen. Eine Sprungmarke besteht aus Buchstaben, Ziffern, Bindestrich und Unterstrich.
|
||||
*/
|
||||
final class SafeUrl implements ValidationRule
|
||||
{
|
||||
@@ -16,6 +17,10 @@ public static function isSafe(mixed $url): bool
|
||||
return false;
|
||||
}
|
||||
|
||||
if (str_starts_with($url, '#')) {
|
||||
return preg_match('/^#[A-Za-z0-9_-]{1,80}$/', $url) === 1;
|
||||
}
|
||||
|
||||
$isRelative = str_starts_with($url, '/') && ! str_starts_with($url, '//') && ! str_starts_with($url, '/\\');
|
||||
$isAbsolute = preg_match('#^https?://[^/\s]+#i', $url) === 1;
|
||||
|
||||
@@ -24,7 +29,7 @@ public static function isSafe(mixed $url): bool
|
||||
|
||||
public static function message(): string
|
||||
{
|
||||
return 'Erlaubt sind Seitenpfade (beginnend mit /) oder http(s)-Adressen.';
|
||||
return 'Erlaubt sind Seitenpfade (beginnend mit /), Sprungmarken (#marke) oder http(s)-Adressen.';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Domain\Cms\Widgets\Types;
|
||||
|
||||
use App\Domain\Cms\Widgets\Support\HeadingAccent;
|
||||
use App\Domain\Cms\Widgets\Support\LinkField;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use App\Domain\Cms\Widgets\WidgetErrors;
|
||||
use App\Domain\Cms\Widgets\WidgetType;
|
||||
@@ -82,12 +83,9 @@ public function dataFields(): array
|
||||
TextInput::make('heading')->label('Überschrift')->required()->maxLength(200),
|
||||
Textarea::make('text')->label('Text')->rows(3)->maxLength(1000),
|
||||
TextInput::make('label')->label('Beschriftung der Schaltfläche')->required()->maxLength(80),
|
||||
TextInput::make('url')
|
||||
->label('Linkziel')
|
||||
LinkField::make('url')
|
||||
->required()
|
||||
->maxLength(500)
|
||||
->rule(SafeUrl::rule())
|
||||
->helperText('Seitenpfad wie /angebote oder eine vollständige http(s)-Adresse.'),
|
||||
->helperText('Seitenpfad wie /angebote, Sprungmarke wie #kurse oder eine vollständige http(s)-Adresse; oder über das Linksymbol eine Seite oder Sprungmarke wählen.'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
use App\Domain\Cms\Widgets\RenderContext;
|
||||
use App\Domain\Cms\Widgets\Support\HeadingAccent;
|
||||
use App\Domain\Cms\Widgets\Support\ImageRefFields;
|
||||
use App\Domain\Cms\Widgets\Support\LinkField;
|
||||
use App\Domain\Cms\Widgets\Support\PublicMedia;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use App\Domain\Cms\Widgets\Support\WebsiteImage;
|
||||
@@ -127,11 +128,8 @@ public function dataFields(): array
|
||||
SymbolField::make('symbol', 'Symbol (optional)')
|
||||
->helperText('Kleine Grafik aus dem Brand-Kit über dem Titel. Größe und Ausrichtung im Reiter „Darstellung“.'),
|
||||
Textarea::make('text')->label('Beschreibung')->rows(2)->maxLength(500),
|
||||
TextInput::make('url')
|
||||
->label('Linkziel')
|
||||
->maxLength(500)
|
||||
->rule(SafeUrl::rule())
|
||||
->helperText('Seitenpfad wie /praevention oder eine http(s)-Adresse. Leer lassen für eine Karte ohne Link.'),
|
||||
LinkField::make('url')
|
||||
->helperText('Seitenpfad wie /praevention, Sprungmarke wie #kurse oder eine http(s)-Adresse; oder über das Linksymbol wählen. Leer lassen für eine Karte ohne Link.'),
|
||||
$image,
|
||||
$upload,
|
||||
$status,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Domain\Cms\Widgets\RenderContext;
|
||||
use App\Domain\Cms\Widgets\Support\HeadingAccent;
|
||||
use App\Domain\Cms\Widgets\Support\LinkField;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use App\Domain\Cms\Widgets\WidgetErrors;
|
||||
use App\Domain\Cms\Widgets\WidgetType;
|
||||
@@ -157,11 +158,8 @@ public function dataFields(): array
|
||||
SymbolField::make('symbol', 'Symbol', required: true),
|
||||
TextInput::make('title')->label('Kurztitel')->required()->maxLength(60),
|
||||
Textarea::make('text')->label('Satz')->rows(2)->maxLength(200),
|
||||
TextInput::make('url')
|
||||
->label('Linkziel (optional)')
|
||||
->maxLength(500)
|
||||
->rule(SafeUrl::rule())
|
||||
->helperText('Seitenpfad wie /materialien oder eine http(s)-Adresse. Leer lassen für ein Merkmal ohne Link.'),
|
||||
LinkField::make('url', 'Linkziel (optional)')
|
||||
->helperText('Seitenpfad wie /materialien, Sprungmarke wie #kurse oder eine http(s)-Adresse; oder über das Linksymbol wählen. Leer lassen für ein Merkmal ohne Link.'),
|
||||
TextInput::make('link_label')
|
||||
->label('Linktext')
|
||||
->maxLength(60)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
use App\Domain\Cms\Widgets\Support\WebsiteImage;
|
||||
use App\Domain\Cms\Widgets\WidgetErrors;
|
||||
use App\Domain\Cms\Widgets\WidgetType;
|
||||
use App\Filament\Support\InternalLinkPlugin;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\ViewField;
|
||||
@@ -222,6 +223,7 @@ public function dataFields(): array
|
||||
->label('Text')
|
||||
->helperText('Leer lassen, wenn nur das Bild gezeigt werden soll. Ohne Text, Überschrift, Label und Schaltflächen füllt das Bild die ganze Breite.')
|
||||
->live(onBlur: true)
|
||||
->plugins([new InternalLinkPlugin])
|
||||
->toolbarButtons(RichText::TOOLBAR),
|
||||
PremiumFields::ctaFields(),
|
||||
PremiumFields::altField(),
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Domain\Cms\LinkTargets;
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\Page as CmsPage;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Domain\Cms\Sections\PageSections;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use App\Filament\Support\Bestand;
|
||||
@@ -74,7 +76,7 @@ class Webpraesenz extends Page
|
||||
/** Ausgewählter Eintrag (Schlüssel „e{id}“ oder „n{zähler}“ für neue Einträge). */
|
||||
public ?string $auswahl = null;
|
||||
|
||||
/** @var array<string, array{id: ?int, label: string, page_id: ?int, url: string, placement: string, parent: ?string, is_visible: bool}> */
|
||||
/** @var array<string, array{id: ?int, label: string, page_id: ?int, url: string, anchor: string, placement: string, parent: ?string, is_visible: bool}> */
|
||||
public array $eintraege = [];
|
||||
|
||||
/** Globale Reihenfolge der Schlüssel; entspricht sort_order. @var list<string> */
|
||||
@@ -103,6 +105,9 @@ class Webpraesenz extends Page
|
||||
/** Eintrag, dessen Ziel gerade gewählt wird. */
|
||||
public ?string $zielwahl = null;
|
||||
|
||||
/** Zweiter Schritt der Zielwahl: gewählte Seite, deren Sprungmarke noch zu wählen ist. */
|
||||
public ?int $zielSeite = null;
|
||||
|
||||
public string $zielSuche = '';
|
||||
|
||||
public static function canAccess(): bool
|
||||
@@ -327,6 +332,7 @@ public function ladeMenues(): void
|
||||
'label' => (string) $item->label,
|
||||
'page_id' => $item->page_id,
|
||||
'url' => (string) ($item->url ?? ''),
|
||||
'anchor' => (string) ($item->anchor ?? ''),
|
||||
'placement' => (string) $item->placement,
|
||||
'parent' => $item->parent_id !== null ? 'e'.$item->parent_id : null,
|
||||
'is_visible' => (bool) $item->is_visible,
|
||||
@@ -364,6 +370,7 @@ private function bereichsStaende(): array
|
||||
trim($e['label']),
|
||||
$e['page_id'] !== null ? (int) $e['page_id'] : null,
|
||||
trim($e['url']),
|
||||
trim($e['anchor'] ?? ''),
|
||||
(bool) $e['is_visible'],
|
||||
$this->elternVon($k),
|
||||
];
|
||||
@@ -562,6 +569,7 @@ public function eintragHinzufuegen(): void
|
||||
'label' => '',
|
||||
'page_id' => null,
|
||||
'url' => '',
|
||||
'anchor' => '',
|
||||
'placement' => $this->menue,
|
||||
'parent' => null,
|
||||
'is_visible' => true,
|
||||
@@ -595,7 +603,7 @@ public function updatedEintraege(mixed $value, string $pfad): void
|
||||
match ($feld) {
|
||||
'placement' => $this->bereichGeaendert($k),
|
||||
'parent' => $this->elternGeaendert($k),
|
||||
'page_id' => $this->eintraege[$k]['page_id'] = blank($value) ? null : (int) $value,
|
||||
'page_id' => $this->seiteGeaendert($k, $value),
|
||||
'is_visible' => $this->eintraege[$k]['is_visible'] = (bool) $value,
|
||||
default => null,
|
||||
};
|
||||
@@ -673,10 +681,18 @@ private function ansEnde(string $k): void
|
||||
$this->folge = [...array_values(array_filter($this->folge, fn (string $x): bool => $x !== $k)), $k];
|
||||
}
|
||||
|
||||
/** Eine andere Zielseite hat eigene Sprungmarken: Die bisherige Marke entfällt. */
|
||||
private function seiteGeaendert(string $k, mixed $value): void
|
||||
{
|
||||
$this->eintraege[$k]['page_id'] = blank($value) ? null : (int) $value;
|
||||
$this->eintraege[$k]['anchor'] = '';
|
||||
}
|
||||
|
||||
public function zielAdresseNutzen(string $k): void
|
||||
{
|
||||
if (isset($this->eintraege[$k])) {
|
||||
$this->eintraege[$k]['page_id'] = null;
|
||||
$this->eintraege[$k]['anchor'] = '';
|
||||
$this->js("requestAnimationFrame(() => document.getElementById('menue-adresse')?.focus())");
|
||||
}
|
||||
}
|
||||
@@ -692,6 +708,7 @@ public function oeffneZielwahl(string $k): void
|
||||
public function schliesseZielwahl(): void
|
||||
{
|
||||
$this->zielwahl = null;
|
||||
$this->zielSeite = null;
|
||||
}
|
||||
|
||||
public function waehleZiel(int $seiteId): void
|
||||
@@ -702,8 +719,48 @@ public function waehleZiel(int $seiteId): void
|
||||
|
||||
$this->eintraege[$this->zielwahl]['page_id'] = $seiteId;
|
||||
$this->eintraege[$this->zielwahl]['url'] = '';
|
||||
$this->eintraege[$this->zielwahl]['anchor'] = '';
|
||||
$this->resetErrorBag("eintraege.{$this->zielwahl}.url");
|
||||
$this->zielwahl = null;
|
||||
|
||||
// Hat die Seite Sprungmarken, folgt als zweiter Schritt die Wahl der Marke; sonst ist die Auswahl fertig.
|
||||
if ($this->zielMarken($seiteId) !== []) {
|
||||
$this->zielSeite = $seiteId;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->schliesseZielwahl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Zweiter Schritt von „Ziel ändern“: Sprungmarke der gewählten Seite übernehmen (leer = Seitenanfang).
|
||||
*/
|
||||
public function waehleMarke(?string $marke = null): void
|
||||
{
|
||||
if ($this->zielwahl === null || $this->zielSeite === null || ! isset($this->eintraege[$this->zielwahl])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$marke = filled($marke) ? $marke : null;
|
||||
|
||||
if ($marke !== null && ! in_array($marke, array_column($this->zielMarken($this->zielSeite), 'anchor'), true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->eintraege[$this->zielwahl]['anchor'] = $marke ?? '';
|
||||
$this->schliesseZielwahl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sprungmarken einer Seite für den zweiten Schritt.
|
||||
*
|
||||
* @return list<array{anchor: string, label: string, hidden: bool, published: bool}>
|
||||
*/
|
||||
public function zielMarken(int $seiteId): array
|
||||
{
|
||||
$seite = $this->seitenCache()->get($seiteId);
|
||||
|
||||
return $seite === null ? [] : app(LinkTargets::class)->anchorsForPage($seite);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -755,7 +812,7 @@ public function zielVon(string $k): array
|
||||
|
||||
return $seite === null
|
||||
? ['art' => 'fehlt', 'titel' => null, 'pfad' => null, 'zustand' => ['label' => 'Zielseite nicht mehr vorhanden', 'ton' => 'achtung'], 'seite' => null]
|
||||
: ['art' => 'seite', 'titel' => $seite->latestRevision?->contentTitle() ?: $seite->path, 'pfad' => $seite->path, 'zustand' => $this->seitenZustand($seite), 'seite' => $seite];
|
||||
: ['art' => 'seite', 'titel' => $seite->latestRevision?->contentTitle() ?: $seite->path, 'pfad' => $seite->path.(trim($e['anchor'] ?? '') !== '' ? '#'.trim($e['anchor']) : ''), 'zustand' => $this->seitenZustand($seite), 'seite' => $seite];
|
||||
}
|
||||
|
||||
if (trim($e['url']) !== '') {
|
||||
@@ -919,6 +976,7 @@ private function pruefen(): array
|
||||
|| $alt->label !== $e['label']
|
||||
|| $alt->page_id !== ($e['page_id'] !== null ? (int) $e['page_id'] : null)
|
||||
|| (string) ($alt->url ?? '') !== $e['url']
|
||||
|| (string) ($alt->anchor ?? '') !== trim($e['anchor'] ?? '')
|
||||
|| $alt->placement !== $e['placement']
|
||||
|| ($alt->parent_id !== null ? 'e'.$alt->parent_id : null) !== $this->elternVon($k)
|
||||
|| (bool) $alt->is_visible !== (bool) $e['is_visible']
|
||||
@@ -936,16 +994,19 @@ private function pruefen(): array
|
||||
'placement' => $e['placement'],
|
||||
'page_id' => $e['page_id'],
|
||||
'url' => trim($e['url']) === '' ? null : trim($e['url']),
|
||||
'anchor' => trim($e['anchor'] ?? '') === '' ? null : trim($e['anchor']),
|
||||
], [
|
||||
'label' => ['required', 'string', 'max:80'],
|
||||
'placement' => ['required', 'in:'.implode(',', array_keys(self::BEREICHE))],
|
||||
'page_id' => ['nullable', 'integer', 'exists:pages,id'],
|
||||
'url' => ['nullable', 'string', 'max:500', SafeUrl::rule()],
|
||||
'anchor' => ['nullable', 'string', 'max:'.PageSections::MAX_ANCHOR, 'regex:'.PageSections::ANCHOR_PATTERN],
|
||||
], [
|
||||
'label.required' => 'Bitte einen Menütext eingeben.',
|
||||
'label.max' => 'Der Menütext hat höchstens 80 Zeichen.',
|
||||
'url.max' => 'Die Adresse hat höchstens 500 Zeichen.',
|
||||
'page_id.exists' => 'Diese Seite gibt es nicht mehr.',
|
||||
'anchor.regex' => 'Die Sprungmarke ist ungültig. Bitte über „Ziel ändern“ eine vorhandene wählen.',
|
||||
]);
|
||||
|
||||
$meldungen = $validator->errors()->toArray();
|
||||
@@ -1044,6 +1105,8 @@ private function schreiben(array $geaendert): array
|
||||
'label' => trim($e['label']),
|
||||
'page_id' => $e['page_id'] !== null ? (int) $e['page_id'] : null,
|
||||
'url' => trim($e['url']) === '' ? null : trim($e['url']),
|
||||
// Eine Sprungmarke gehört zur Zielseite; ohne Seite (freie Adresse) entfällt sie.
|
||||
'anchor' => $e['page_id'] !== null && trim($e['anchor'] ?? '') !== '' ? trim($e['anchor']) : null,
|
||||
'placement' => $e['placement'],
|
||||
'parent_id' => $eltern !== null ? ($ids[$eltern] ?? $this->eintraege[$eltern]['id']) : null,
|
||||
'is_visible' => (bool) $e['is_visible'],
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use App\Filament\Support\ChoosesLinkTargets;
|
||||
use App\Filament\Support\ChoosesWebsiteImages;
|
||||
use App\Filament\Support\ReportsSectionErrors;
|
||||
use App\Filament\Support\SectionEditor;
|
||||
@@ -18,6 +19,7 @@
|
||||
|
||||
class CreatePage extends CreateRecord
|
||||
{
|
||||
use ChoosesLinkTargets;
|
||||
use ChoosesWebsiteImages;
|
||||
use ReportsSectionErrors;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use App\Filament\Support\ChoosesLinkTargets;
|
||||
use App\Filament\Support\ChoosesWebsiteImages;
|
||||
use App\Filament\Support\ReportsSectionErrors;
|
||||
use App\Filament\Support\SectionEditor;
|
||||
@@ -22,6 +23,7 @@
|
||||
|
||||
class EditPage extends EditRecord
|
||||
{
|
||||
use ChoosesLinkTargets;
|
||||
use ChoosesWebsiteImages;
|
||||
use ReportsSectionErrors;
|
||||
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Support;
|
||||
|
||||
use App\Domain\Cms\LinkTargets;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
|
||||
/**
|
||||
* Auswahl interner Linkziele im CMS über einen Dialog (filament.cms.link-picker): erst die Seite, dann auf Wunsch eine
|
||||
* Sprungmarke. Ein Linkfeld (Widgets\Support\LinkField) öffnet den Dialog mit seinem Formularpfad; „übernehmen“ schreibt die Adresse in
|
||||
* genau dieses Feld, auch im geöffneten Bausteindialog. Gespeichert wird weiterhin nur mit dem Seitenentwurf. Die
|
||||
* Auswahl ändert keine Seite und veröffentlicht nichts.
|
||||
*
|
||||
* Die Sprungmarken der Seite, die gerade bearbeitet wird, stammen aus dem Formular und enthalten damit auch
|
||||
* ungespeicherte Marken.
|
||||
*/
|
||||
trait ChoosesLinkTargets
|
||||
{
|
||||
/** Formularpfad des Linkfelds, in das die Adresse übernommen wird; null = Dialog geschlossen. */
|
||||
public ?string $linkZiel = null;
|
||||
|
||||
public string $linkSuche = '';
|
||||
|
||||
/** Gewählte Seite im zweiten Schritt: „diese“ (Seite im Editor) oder die Kennung einer Seite. */
|
||||
public ?string $linkSeite = null;
|
||||
|
||||
public function openLinkPicker(string $pfad): void
|
||||
{
|
||||
if (preg_match('/^(data|mountedActions\.\d+\.data)(\.[A-Za-z0-9_-]+)+$/', $pfad) !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->linkZiel = $pfad;
|
||||
$this->linkSuche = '';
|
||||
$this->linkSeite = null;
|
||||
$this->forceRenderForLinkPicker();
|
||||
}
|
||||
|
||||
public function closeLinkPicker(): void
|
||||
{
|
||||
$this->linkZiel = null;
|
||||
$this->linkSeite = null;
|
||||
$this->linkSuche = '';
|
||||
$this->forceRenderForLinkPicker();
|
||||
}
|
||||
|
||||
public function chooseLinkPage(string $key): void
|
||||
{
|
||||
if ($this->linkZiel === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($key === 'diese' ? ! $this->linkHasOwnPage() : ! Page::query()->whereKey((int) $key)->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->linkSeite = $key;
|
||||
}
|
||||
|
||||
public function backToLinkPages(): void
|
||||
{
|
||||
$this->linkSeite = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ?string $anchor Sprungmarke; leer = Seitenanfang (nur für andere Seiten)
|
||||
*/
|
||||
public function applyLink(?string $anchor = null): void
|
||||
{
|
||||
if ($this->linkZiel === null || $this->linkSeite === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$targets = app(LinkTargets::class);
|
||||
$anchor = filled($anchor) ? $anchor : null;
|
||||
|
||||
if ($this->linkSeite === 'diese') {
|
||||
$known = array_column($targets->anchorsInEditor($this->linkEditorSections()), 'anchor');
|
||||
|
||||
if ($anchor === null || ! in_array($anchor, $known, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$href = $targets->href(null, $anchor);
|
||||
} else {
|
||||
$page = Page::query()->with(['latestRevision', 'publishedRevision'])->find((int) $this->linkSeite);
|
||||
|
||||
if (! $page instanceof Page) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($anchor !== null && ! in_array($anchor, array_column($targets->anchorsForPage($page), 'anchor'), true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$href = $targets->href($page->path, $anchor);
|
||||
}
|
||||
|
||||
if (! SafeUrl::isSafe($href)) {
|
||||
return;
|
||||
}
|
||||
|
||||
data_set($this, $this->linkZiel, $href);
|
||||
$this->closeLinkPicker();
|
||||
}
|
||||
|
||||
/**
|
||||
* Seiten im ersten Schritt (ohne die bearbeitete Seite, die als „Diese Seite“ oben steht).
|
||||
*
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function linkPages(): array
|
||||
{
|
||||
return app(LinkTargets::class)->pages($this->linkSuche, $this->linkOwnPageId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Daten des zweiten Schritts: gewählte Seite, ihre Sprungmarken und die vollständige Adresse.
|
||||
*
|
||||
* @return array{titel: string, pfad: ?string, diese: bool, marken: list<array<string, mixed>>, offen: bool, adresse: ?string}|null
|
||||
*/
|
||||
public function linkChosen(): ?array
|
||||
{
|
||||
if ($this->linkSeite === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$targets = app(LinkTargets::class);
|
||||
|
||||
if ($this->linkSeite === 'diese') {
|
||||
$record = $this->linkOwnPage();
|
||||
|
||||
return [
|
||||
'titel' => 'Diese Seite',
|
||||
'pfad' => $record?->path,
|
||||
'diese' => true,
|
||||
'marken' => $targets->anchorsInEditor($this->linkEditorSections()),
|
||||
'offen' => $record === null,
|
||||
'adresse' => $record?->published_revision_id !== null ? $targets->publicUrl($record) : null,
|
||||
];
|
||||
}
|
||||
|
||||
$page = Page::query()->with(['latestRevision', 'publishedRevision'])->find((int) $this->linkSeite);
|
||||
|
||||
if (! $page instanceof Page) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'titel' => $page->latestRevision?->contentTitle() ?: $page->path,
|
||||
'pfad' => $page->path,
|
||||
'diese' => false,
|
||||
'marken' => $targets->anchorsForPage($page),
|
||||
'offen' => false,
|
||||
'adresse' => $page->published_revision_id !== null ? $targets->publicUrl($page) : null,
|
||||
];
|
||||
}
|
||||
|
||||
/** Hat die Seite im Editor schon Sprungmarken oder eine Adresse? Neue Seiten dürfen auf ihre eigenen Marken zeigen. */
|
||||
public function linkHasOwnPage(): bool
|
||||
{
|
||||
return property_exists($this, 'data');
|
||||
}
|
||||
|
||||
public function linkOwnPage(): ?Page
|
||||
{
|
||||
$record = property_exists($this, 'record') ? ($this->record ?? null) : null;
|
||||
|
||||
return $record instanceof Page ? $record : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sprungmarken der Seite im Editor (auch ungespeicherte).
|
||||
*
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function linkOwnAnchors(): array
|
||||
{
|
||||
return $this->linkHasOwnPage() ? app(LinkTargets::class)->anchorsInEditor($this->linkEditorSections()) : [];
|
||||
}
|
||||
|
||||
private function linkOwnPageId(): ?int
|
||||
{
|
||||
return $this->linkOwnPage()?->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
private function linkEditorSections(): array
|
||||
{
|
||||
$state = is_array($this->data['sections'] ?? null) ? $this->data['sections'] : [];
|
||||
|
||||
return SectionEditor::fromEditorState($state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filament rendert bei offenen Aktionsdialogen nur den Dialogteil neu; der Auswahldialog liegt darüber und braucht
|
||||
* die ganze Seite.
|
||||
*/
|
||||
public function hydrateChoosesLinkTargets(): void
|
||||
{
|
||||
if ($this->linkZiel !== null) {
|
||||
$this->forceRenderForLinkPicker();
|
||||
}
|
||||
}
|
||||
|
||||
private function forceRenderForLinkPicker(): void
|
||||
{
|
||||
if (method_exists($this, 'forceRender')) {
|
||||
$this->forceRender();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Support;
|
||||
|
||||
use App\Domain\Cms\LinkTargets;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\RichEditor\EditorCommand;
|
||||
use Filament\Forms\Components\RichEditor\Plugins\Contracts\RichContentPlugin;
|
||||
use Filament\Forms\Components\RichEditor\RichEditorTool;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
/**
|
||||
* Werkzeug „Interne Seite oder Sprungmarke verlinken“ für die Texte der Website: wählt eine Seite der Website und auf
|
||||
* Wunsch eine Sprungmarke und setzt daraus den Link am markierten Text. Es ergänzt das Werkzeug „Link“ (freie Adresse),
|
||||
* ersetzt es nicht. Gleiche Ziele wie der Linkdialog der Felder ({@see ChoosesLinkTargets}); gespeichert wird nur mit dem
|
||||
* Seitenentwurf, veröffentlicht wird nichts.
|
||||
*/
|
||||
final class InternalLinkPlugin implements RichContentPlugin
|
||||
{
|
||||
public function getTipTapPhpExtensions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getTipTapJsExtensions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getEditorTools(): array
|
||||
{
|
||||
return [
|
||||
RichEditorTool::make('interneSeite')
|
||||
->label('Interne Seite oder Sprungmarke verlinken')
|
||||
->icon(Heroicon::DocumentText)
|
||||
->action(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getEditorActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('interneSeite')
|
||||
->label('Interne Seite oder Sprungmarke verlinken')
|
||||
->modalHeading('Interne Seite oder Sprungmarke verlinken')
|
||||
->modalDescription('Der markierte Text wird zum Link auf eine Seite dieser Website oder auf eine Sprungmarke. Eine freie Adresse setzt das Werkzeug „Link“.')
|
||||
->modalWidth(Width::Large)
|
||||
->modalSubmitActionLabel('Link setzen')
|
||||
->schema([
|
||||
Select::make('seite')
|
||||
->label('Seite')
|
||||
->options(fn ($livewire): array => self::pageOptions($livewire))
|
||||
->searchable()
|
||||
->required()
|
||||
->live()
|
||||
->afterStateUpdated(fn (callable $set) => $set('marke', null)),
|
||||
Select::make('marke')
|
||||
->label('Sprungmarke')
|
||||
->placeholder('Seitenanfang (ohne Sprungmarke)')
|
||||
->options(fn (Get $get, $livewire): array => self::anchorOptions($get('seite'), $livewire))
|
||||
->required(fn (Get $get): bool => $get('seite') === 'diese')
|
||||
->visible(fn (Get $get): bool => filled($get('seite')))
|
||||
->helperText('Ausgeblendete Abschnitte sind gekennzeichnet; ein Link auf sie führt ins Leere.'),
|
||||
])
|
||||
->action(function (array $arguments, array $data, RichEditor $component): void {
|
||||
$href = self::href((string) ($data['seite'] ?? ''), $data['marke'] ?? null, $component->getLivewire());
|
||||
|
||||
if ($href === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$collapsed = ($arguments['editorSelection']['head'] ?? null) === ($arguments['editorSelection']['anchor'] ?? null);
|
||||
|
||||
$component->runCommands([
|
||||
...($collapsed ? [EditorCommand::make('extendMarkRange', arguments: ['link'])] : []),
|
||||
EditorCommand::make('setLink', arguments: [['href' => $href, 'target' => null]]),
|
||||
], editorSelection: $arguments['editorSelection']);
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private static function pageOptions(mixed $livewire): array
|
||||
{
|
||||
$options = [];
|
||||
|
||||
if (self::editsPage($livewire)) {
|
||||
$options['diese'] = 'Diese Seite';
|
||||
}
|
||||
|
||||
$own = is_object($livewire) && method_exists($livewire, 'linkOwnPage') ? $livewire->linkOwnPage() : null;
|
||||
|
||||
foreach (app(LinkTargets::class)->pages('', $own?->getKey()) as $page) {
|
||||
$options[(string) $page['id']] = $page['titel'].' ('.$page['pfad'].')';
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private static function anchorOptions(mixed $seite, mixed $livewire): array
|
||||
{
|
||||
$anchors = self::anchorsOf((string) $seite, $livewire);
|
||||
|
||||
return collect($anchors)->mapWithKeys(fn (array $anchor): array => [
|
||||
$anchor['anchor'] => $anchor['label'].' (#'.$anchor['anchor'].')'.($anchor['hidden'] ? ' – ausgeblendet' : ''),
|
||||
])->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{anchor: string, label: string, hidden: bool}>
|
||||
*/
|
||||
private static function anchorsOf(string $seite, mixed $livewire): array
|
||||
{
|
||||
$targets = app(LinkTargets::class);
|
||||
|
||||
if ($seite === 'diese') {
|
||||
return self::editsPage($livewire) ? $targets->anchorsInEditor(SectionEditor::fromEditorState(is_array($livewire->data['sections'] ?? null) ? $livewire->data['sections'] : [])) : [];
|
||||
}
|
||||
|
||||
$page = Page::query()->with(['latestRevision', 'publishedRevision'])->find((int) $seite);
|
||||
|
||||
return $page instanceof Page ? $targets->anchorsForPage($page) : [];
|
||||
}
|
||||
|
||||
private static function editsPage(mixed $livewire): bool
|
||||
{
|
||||
return is_object($livewire) && method_exists($livewire, 'linkOwnAnchors');
|
||||
}
|
||||
|
||||
private static function href(string $seite, mixed $anchor, mixed $livewire): ?string
|
||||
{
|
||||
$targets = app(LinkTargets::class);
|
||||
$anchor = is_string($anchor) && $anchor !== '' ? $anchor : null;
|
||||
|
||||
if ($anchor !== null && ! in_array($anchor, array_column(self::anchorsOf($seite, $livewire), 'anchor'), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($seite === 'diese') {
|
||||
$href = self::editsPage($livewire) ? $targets->href(null, $anchor) : null;
|
||||
} else {
|
||||
$page = Page::query()->find((int) $seite);
|
||||
$href = $page instanceof Page ? $targets->href($page->path, $anchor) : null;
|
||||
}
|
||||
|
||||
return SafeUrl::isSafe($href) ? $href : null;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,8 @@ public static function make(string $name, ?string $label = null, bool $live = tr
|
||||
$toolbar = FormattedText::TOOLBAR;
|
||||
|
||||
if ($website) {
|
||||
// Interne Seite oder Sprungmarke verlinken, gleich neben dem freien Link.
|
||||
$toolbar[0] = [...$toolbar[0], 'interneSeite'];
|
||||
array_splice($toolbar, 1, 0, [['fontSize', 'textColor'], ['alignStart', 'alignCenter', 'alignEnd']]);
|
||||
}
|
||||
|
||||
@@ -45,7 +47,7 @@ public static function make(string $name, ?string $label = null, bool $live = tr
|
||||
|
||||
if ($website) {
|
||||
$field
|
||||
->plugins([new FontSizePlugin])
|
||||
->plugins([new FontSizePlugin, new InternalLinkPlugin])
|
||||
->textColors(Arr::mapWithKeys(
|
||||
FormattedText::SITE_COLORS,
|
||||
fn (string $label, string $key): array => [$key => TextColor::make($label, self::SITE_COLOR_VALUES[$key])],
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Schemas\Components\Group;
|
||||
@@ -27,7 +29,7 @@
|
||||
* Rasterverhältnis) → je Platz ein Widget (Builder mit höchstens einem Eintrag, Auswahl aus dem Widget-Register).
|
||||
* Abschnittseinstellungen stehen im Abschnitt, Widget-Einstellungen im Widget-Dialog: eine Dialogebene.
|
||||
*
|
||||
* Formularzustand eines Abschnitts: {id, layout, style: {...}, slots: {uuid: {widget: {uuid: Builder-Eintrag}}}}.
|
||||
* Formularzustand eines Abschnitts: {id, name, anchor, hidden, layout, style: {...}, slots: {uuid: {widget: {uuid: Builder-Eintrag}}}}.
|
||||
*/
|
||||
class SectionEditor
|
||||
{
|
||||
@@ -91,6 +93,7 @@ private static function sectionSchema(): array
|
||||
{
|
||||
return [
|
||||
Hidden::make('id'),
|
||||
self::labelSection(),
|
||||
// Abschnittsgestaltung in drei Gruppen. Im Seiten-Arbeitsplatz nur im Kontext „Abschnitt gestalten“
|
||||
// sichtbar und dort offen; beim Anlegen einer Seite an jedem Abschnitt, eingeklappt.
|
||||
Section::make('Raster und Breite')
|
||||
@@ -154,6 +157,68 @@ private static function sectionSchema(): array
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Name, Sprungmarke und Sichtbarkeit: stehen im Seitenaufbau am Abschnitt, damit man sie beim Ordnen der Seite sieht.
|
||||
*/
|
||||
private static function labelSection(): Section
|
||||
{
|
||||
return Section::make('Name, Sprungmarke und Sichtbarkeit')
|
||||
->columnSpanFull()
|
||||
->compact()
|
||||
->collapsible()
|
||||
->collapsed(fn (Get $get): bool => blank($get('name')) && blank($get('anchor')) && ! $get('hidden'))
|
||||
->extraAttributes(['class' => 'luf-abschnitt-bezeichnung'])
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label('Name des Abschnitts')
|
||||
->placeholder('Zum Beispiel „Kursübersicht“')
|
||||
->maxLength(PageSections::MAX_NAME)
|
||||
->live(onBlur: true)
|
||||
->hintIcon('heroicon-m-information-circle', tooltip: 'Nur zur Orientierung im Seitenaufbau und in der Linkauswahl. Der Name erscheint nie auf der Website.')
|
||||
->hintColor('gray'),
|
||||
TextInput::make('anchor')
|
||||
->label('Sprungmarke')
|
||||
->prefix('#')
|
||||
->placeholder('zum-beispiel-kurse')
|
||||
->maxLength(PageSections::MAX_ANCHOR)
|
||||
->live(onBlur: true)
|
||||
->afterStateUpdated(function (?string $state, Set $set): void {
|
||||
$set('anchor', filled($state) ? Str::slug($state, '-', 'de') : null);
|
||||
})
|
||||
->suffixAction(Action::make('anchorFromName')
|
||||
->label('Sprungmarke aus dem Namen vorschlagen')
|
||||
->icon('heroicon-o-sparkles')
|
||||
->tooltip('Aus dem Namen vorschlagen')
|
||||
->action(fn (Get $get, Set $set) => $set('anchor', Str::limit(Str::slug((string) $get('name'), '-', 'de'), PageSections::MAX_ANCHOR, ''))))
|
||||
->hintIcon('heroicon-m-information-circle', tooltip: 'Macht den Abschnitt zum Ziel eines Links. Auf derselben Seite genügt „#marke“, von anderen Seiten und von außen „Adresse der Seite#marke“. Nur Kleinbuchstaben, Ziffern und Bindestriche; jede Marke einmal je Seite.')
|
||||
->hintColor('gray')
|
||||
->helperText(fn (Get $get, $livewire): ?string => self::anchorLinkText($get('anchor'), $livewire)),
|
||||
Toggle::make('hidden')
|
||||
->label('Auf der Website ausblenden')
|
||||
->live()
|
||||
->hintIcon('heroicon-m-information-circle', tooltip: 'Der Abschnitt bleibt im Entwurf erhalten, erscheint aber nicht auf der Website. Auch eine Sprungmarke dieses Abschnitts führt dann ins Leere. In der Seitenvorschau steht an seiner Stelle ein Hinweis.')
|
||||
->hintColor('gray')
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(['default' => 1, 'md' => 2]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vollständiger Link zur Sprungmarke (für Verweise von außen); eine neue Seite hat noch keine Adresse.
|
||||
*/
|
||||
private static function anchorLinkText(mixed $anchor, mixed $livewire): ?string
|
||||
{
|
||||
if (! is_string($anchor) || $anchor === '') {
|
||||
return 'Ohne Sprungmarke ist der Abschnitt kein Linkziel.';
|
||||
}
|
||||
|
||||
$path = is_object($livewire) && property_exists($livewire, 'record') && is_object($livewire->record ?? null) ? ($livewire->record->path ?? null) : null;
|
||||
|
||||
return is_string($path) && $path !== ''
|
||||
? 'Link von anderen Seiten: '.($path === '/' ? '' : $path).'#'.$anchor.' · von außen: '.url($path === '/' ? '/' : $path).'#'.$anchor
|
||||
: 'Link auf dieser Seite: #'.$anchor.'. Die Adresse für Verweise von außen steht nach dem ersten Speichern fest.';
|
||||
}
|
||||
|
||||
private static function onWorkplace(mixed $livewire): bool
|
||||
{
|
||||
return is_object($livewire) && method_exists($livewire, 'openAbschnitt');
|
||||
@@ -257,6 +322,9 @@ public static function toEditorState(array $sections): array
|
||||
|
||||
$state[] = [
|
||||
'id' => $section['id'] ?? (string) Str::uuid(),
|
||||
'name' => $section['name'] ?? null,
|
||||
'anchor' => $section['anchor'] ?? null,
|
||||
'hidden' => (bool) ($section['hidden'] ?? false),
|
||||
'layout' => $section['layout'],
|
||||
'style' => SectionStyle::fromStored($section['style'] ?? []),
|
||||
'slots' => $slots,
|
||||
@@ -289,6 +357,9 @@ public static function fromEditorState(?array $state): array
|
||||
|
||||
$sections[] = [
|
||||
'id' => $section['id'] ?? null,
|
||||
'name' => is_string($section['name'] ?? null) ? $section['name'] : null,
|
||||
'anchor' => is_string($section['anchor'] ?? null) ? $section['anchor'] : null,
|
||||
'hidden' => (bool) ($section['hidden'] ?? false),
|
||||
'layout' => $section['layout'] ?? SectionLayouts::DEFAULT,
|
||||
'style' => is_array($section['style'] ?? null) ? $section['style'] : [],
|
||||
'slots' => $slots,
|
||||
@@ -484,7 +555,12 @@ public static function insertCopyAfter(array $items, string $key, string $newKey
|
||||
foreach ($items as $itemKey => $item) {
|
||||
$result[$itemKey] = $item;
|
||||
if ((string) $itemKey === $key) {
|
||||
$result[$newKey] = $item;
|
||||
// Eine Sprungmarke gibt es je Seite nur einmal: Die Kopie bekommt keine, der Name wird kenntlich gemacht.
|
||||
$copy = is_array($item) ? $item : [];
|
||||
$copy['anchor'] = null;
|
||||
$name = is_string($copy['name'] ?? null) ? trim($copy['name']) : '';
|
||||
$copy['name'] = $name !== '' ? Str::limit($name, PageSections::MAX_NAME - 9, '').' (Kopie)' : null;
|
||||
$result[$newKey] = $copy;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,13 +638,25 @@ private static function sectionLabel(array $state, ?int $index): HtmlString
|
||||
$meta[] = 'noch leer';
|
||||
}
|
||||
|
||||
$name = 'Abschnitt '.(($index ?? 0) + 1);
|
||||
$number = 'Abschnitt '.(($index ?? 0) + 1);
|
||||
$given = PageSections::cleanName($state['name'] ?? null);
|
||||
$anchor = PageSections::cleanAnchor($state['anchor'] ?? null);
|
||||
$hidden = (bool) ($state['hidden'] ?? false);
|
||||
$full = 'Raster '.SectionLayouts::short($layout).' · '.SectionStyle::summary($style)
|
||||
.($names === [] ? ' · noch leer' : ' · '.implode(', ', $names));
|
||||
|
||||
return new HtmlString('<span class="luf-abschnitt" title="'.e($full).'"><span class="luf-abschnitt-nr">'.e($name).'</span>'
|
||||
// Der Name steht vorn; die Nummer bleibt als Orientierung daneben. Sprungmarke und „Ausgeblendet“ sind auch
|
||||
// für Screenreader lesbar, die Nummer und die Rastermeta nicht doppelt.
|
||||
$text = $given !== null ? $given : $number;
|
||||
$badges = ($anchor !== null ? '<span class="luf-abschnitt-marke" title="Sprungmarke">#'.e($anchor).'</span>' : '')
|
||||
.($hidden ? '<span class="luf-abschnitt-aus" title="Auf der Website ausgeblendet">Ausgeblendet</span>' : '');
|
||||
$spoken = ($given !== null ? $number.': ' : '').($anchor !== null ? 'Sprungmarke '.$anchor.'. ' : '').($hidden ? 'Auf der Website ausgeblendet. ' : '').$full;
|
||||
|
||||
return new HtmlString('<span class="luf-abschnitt'.($hidden ? ' is-ausgeblendet' : '').'" title="'.e(($given !== null ? $number.' · ' : '').$full).'"><span class="luf-abschnitt-nr">'.e($text).'</span>'
|
||||
.($given !== null ? '<span class="luf-abschnitt-nummer" aria-hidden="true">'.e($number).'</span>' : '')
|
||||
.$badges
|
||||
.'<span class="luf-abschnitt-meta" aria-hidden="true">'.e(implode(' · ', $meta)).'</span>'
|
||||
.'<span class="vw-sr">: '.e($full).'</span></span>');
|
||||
.'<span class="vw-sr">: '.e($spoken).'</span></span>');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Ergänzend und abwärtskompatibel: Ein Menüeintrag mit Zielseite kann auf eine Sprungmarke dieser Seite zeigen.
|
||||
* Ohne Wert (bisher alle Einträge) führt er zum Seitenanfang. Ältere Programmstände ignorieren die Spalte.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('navigation_items', function (Blueprint $table) {
|
||||
$table->string('anchor', 60)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('navigation_items', function (Blueprint $table) {
|
||||
$table->dropColumn('anchor');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Alltagsnah</title><path d="M32 22 Q33 15 39 15 Q40 5 49 7 Q57 8 57 17 Q64 20 60 30 Q57 36 50 34 M49 23 V53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 32 L24 13 L44 32 M8 29 V53 H40 V29 M19 53 V38 H29 V53 M4 53 H59" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 473 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Altersgerecht</title><g fill="none" stroke="#08264D" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 31 C11 38 16 42 21 42 C27 42 32 37 31 30 L30 27"/><circle cx="46" cy="32" r="9"/><path d="M37 28 C34 22 32 25 30 29 M55 28 C58 22 60 25 62 29"/><path d="M6 56 C6 48 12 43 20.5 43 C28 43 33 49 33 56 C33 49 38 43 46 43 C54 43 60 49 60 56"/><path d="M19 36 Q21 38 24 36 M43 36 Q46 38 49 36" stroke-width="1.5"/></g><g fill="none" stroke="#397D0D" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 30 C11 23 16 19 21 19 C26 19 30 23 31 27 M5 31 L31 27"/></g><g fill="none" stroke="#FFCD00" stroke-width="3.2" stroke-linecap="round"><path d="M27 13 L23 8 M32 11 V4 M38 13 L42 8"/></g></svg>
|
||||
|
After Width: | Height: | Size: 837 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Ausgrenzung</title><circle cx="11" cy="23" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="25" cy="23" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 49 V41 Q3 31 11 31 Q20 31 20 41 V49 M20 41 Q20 31 25 31 Q33 31 33 41 V49" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M41 13 Q31 30 39 53" stroke="#08264D" stroke-width="3.2" fill="none" stroke-dasharray="4 5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="51" cy="33" r="5.5" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M42 53 Q42 42 51 42 Q60 42 60 53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 828 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Eltern</title><circle cx="15" cy="19" r="7" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="49" cy="19" r="7" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M4 48 V42 C4 27 24 27 26 37 M60 48 V42 C60 27 40 27 38 37" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="32" cy="32" r="5.5" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M21 53 V51 C21 35 43 35 43 51 V53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 8 L21 4 M32 7 V2 M40 8 L43 4" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 792 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><circle cx="20" cy="23" fill="none" r="9" stroke="#08264D" stroke-width="3.2" /><circle cx="43" cy="23" fill="none" r="9" stroke="#08264D" stroke-width="3.2" /><circle cx="17" cy="21" fill="#08264D" r="1.2" /><circle cx="23" cy="21" fill="#08264D" r="1.2" /><circle cx="40" cy="21" fill="#08264D" r="1.2" /><circle cx="46" cy="21" fill="#08264D" r="1.2" /><path d="M16 27 Q20 30.2 24 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9" /><path d="M39 27 Q43 30.2 47 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9" /><path d="M5 53 Q5 40 14 36" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><path d="M54 43 Q60 47 60 53" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><path d="M30 53 L27 40 Q29 36 35 35" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M50 34 Q60 36 57 42 Q54 47 48 43 Q45 41 48 36" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="51" x2="53" y1="8" y2="3" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="56" x2="61" y1="12" y2="8" /></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Geschützt</title><circle cx="32" cy="23" r="6" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M21 39 Q23 30 32 30 Q41 30 43 39" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M17 59 V53 L7 44 L4 33 Q3 29 6 28 Q10 27 11 32 L13 41 L23 49 M27 59 V51 Q27 46 22 42 L16 37 Q12 36 13 41 L20 47 M47 59 V53 L57 44 L60 33 Q61 29 58 28 Q54 27 53 32 L51 41 L41 49 M37 59 V51 Q37 46 42 42 L48 37 Q52 36 51 41 L44 47" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M23 12 L19 7 M32 10 V3 M41 12 L45 7" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 808 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Gewaltschutztrainer</title><circle cx="17" cy="15" r="8" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 53 V39 Q3 28 12 25 M24 25 Q28 26 30 29 M35 26 Q44 24 49 20 Q54 24 61 26 V37 Q60 49 49 56 Q37 49 35 37 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 26 L17 40 L24 26 M17 45 V50" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="17" cy="42" r="3" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M43 39 V34 Q43 32 45 32 V38 V29 Q47 27 48 29 V37 V27 Q50 25 51 28 V37 V30 Q53 28 54 31 V39 Q54 46 49 46 Q44 46 41 40 Q40 37 43 39 Z" stroke="#397D0D" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M51 12 L53 6 M57 15 L61 11" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 1003 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Gruppen</title><circle cx="32" cy="14" r="7" stroke="#397D0D" stroke-width="3.2" fill="none"/><circle cx="12" cy="22" r="6" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="52" cy="22" r="6" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 48 Q3 32 18 32 M61 48 Q61 32 46 32 M17 50 V44 C17 24 47 24 47 44 V50 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 528 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><path d="M14 14 H50 V38 H29 L20 47 V38 H14 Z" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><circle cx="24" cy="26" fill="#397D0D" r="2.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="31" x2="43" y1="26" y2="26" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="31" x2="38" y1="32" y2="32" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="46" x2="50" y1="12" y2="8" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="50" x2="55" y1="18" y2="17" /></svg>
|
||||
|
After Width: | Height: | Size: 845 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><circle cx="32" cy="28" fill="none" r="15" stroke="#08264D" stroke-width="3.2" /><circle cx="32" cy="21" fill="#397D0D" r="1.8" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="27" y2="38" /><line stroke="#08264D" stroke-linecap="round" stroke-width="3.2" x1="28" x2="36" y1="42" y2="42" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="43" x2="48" y1="16" y2="12" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="46" x2="52" y1="22" y2="21" /></svg>
|
||||
|
After Width: | Height: | Size: 784 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><rect fill="none" height="20" rx="2" ry="2" stroke="#08264D" stroke-width="3.2" width="40" x="12" y="28" /><path d="M10 28 L32 15 L54 28" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><rect fill="none" height="12" stroke="#397D0D" stroke-width="3.2" width="8" x="28" y="36" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="19" x2="24" y1="40" y2="40" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="18" x2="24" y1="35" y2="35" /><path d="M40 38 Q42 32 47 35" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="44" x2="47" y1="14" y2="9" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="49" x2="53" y1="17" y2="15" /></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><path d="M12 22 Q32 14 52 22" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M14 27 Q32 20 50 27" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M16 32 Q32 26 48 32" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M27 17 L37 17 L37 39 L32 34 L27 39 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /></svg>
|
||||
|
After Width: | Height: | Size: 805 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><circle cx="13" cy="19" fill="none" r="6.5" stroke="#08264D" stroke-width="3.2" /><circle cx="51" cy="19" fill="none" r="6.5" stroke="#08264D" stroke-width="3.2" /><path d="M3 36 Q4 28 13 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-width="3.2" /><path d="M61 36 Q60 28 51 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-width="3.2" /><circle cx="32" cy="32" fill="none" r="8" stroke="#08264D" stroke-width="3.2" /><circle cx="29" cy="30" fill="#08264D" r="1.2" /><circle cx="35" cy="30" fill="#08264D" r="1.2" /><path d="M28 36.8 Q32 33.8 36 36.8" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" /><path d="M19 55 Q22 43 32 43 Q42 43 45 55" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="28" x2="26" y1="12" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="34" x2="37" y1="12" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="39" x2="45" y1="16" y2="12" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="16" x2="21" y1="36" y2="40" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="13" x2="20" y1="45" y2="45" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="48" x2="43" y1="36" y2="40" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="51" x2="44" y1="45" y2="45" /></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Nachhaltigkeit</title><path d="M7 31 A25 25 0 0 1 53 17 M53 9 V18 L44 15 M57 32 A25 25 0 0 1 11 47 M11 55 V46 L20 49" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 41 C15 27 35 28 43 19 C46 37 35 48 24 41 Z M22 46 Q25 35 35 30" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 483 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Öffentliche Einrichtungen</title><path d="M5 23 L32 8 L59 23 Q59 25 56 25 H8 Q5 25 5 23 Z M10 29 H54 M12 49 H52 M10 53 H54 M14 29 V49 M21 29 V49 M28 29 V49 M36 29 V49 M43 29 V49 M50 29 V49" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 58 H59" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 499 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><path d="M18 14 L46 20 V34 Q46 47 32 53 Q18 47 18 34 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /><path d="M24 35 L30 29 L35 34 L42 25" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="30" x2="28" y1="12" y2="7" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="36" x2="38" y1="12" y2="7" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="42" x2="46" y1="15" y2="12" /></svg>
|
||||
|
After Width: | Height: | Size: 818 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Praxiserprobt</title><path d="M33.80 9.07 L38.07 6.72 L41.95 7.98 L44.02 12.39 L46.94 14.51 L51.77 15.11 L54.17 18.42 L53.25 23.20 L54.36 26.63 L57.92 29.96 L57.92 34.04 L54.36 37.37 L53.25 40.80 L54.17 45.58 L51.77 48.89 L46.94 49.49 L44.02 51.61 L41.95 56.02 L38.07 57.28 L33.80 54.93 L30.20 54.93 L25.93 57.28 L22.05 56.02 L19.98 51.61 L17.06 49.49 L12.23 48.89 L9.83 45.58 L10.75 40.80 L9.64 37.37 L6.08 34.04 L6.08 29.96 L9.64 26.63 L10.75 23.20 L9.83 18.42 L12.23 15.11 L17.06 14.51 L19.98 12.39 L22.05 7.98 L25.93 6.72 L30.20 9.07 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 32 L29 40 L44 24" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 860 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Relevant</title><path d="M44 11 A24 24 0 1 0 55 24" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M36 19 A16 16 0 1 0 46 29" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M29 27 A7 7 0 1 0 37 35" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M32 33 L51 14 M51 14 L49 8 L56 2 L57 9 L63 10 L56 17 Z" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 667 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 65 65"><title>Relevant</title><path d="M42.1428 11.2486 A24 24 0 1 0 53.7514 22.8572" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M36.9443 17.7831 A16 16 0 1 0 47.2169 28.0557" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M32.0000 26.0000 A7 7 0 1 0 39.0000 33.0000" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M32 33 L51 14 M51 14 L49 8 L56 2 L57 9 L63 10 L56 17 Z" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 727 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Schulen</title><path d="M5 31 L12 21 H21 L32 12 L43 21 H52 L59 31 M8 31 V53 H56 V31 M5 31 H19 M45 31 H59 M26 53 V43 Q26 40 29 40 H35 Q38 40 38 43 V53 M14 37 V40 M20 37 V40 M44 37 V40 M50 37 V40" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="32" cy="26" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M32 23 V26 L34 27 M32 12 L34 3 L45 4 L43 11 L33 10" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 625 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><circle cx="18" cy="17" fill="none" r="4.8" stroke="#08264D" stroke-width="3.2" /><circle cx="32" cy="13" fill="none" r="4.8" stroke="#397D0D" stroke-width="3.2" /><circle cx="46" cy="17" fill="none" r="4.8" stroke="#08264D" stroke-width="3.2" /><path d="M18 24 L27 33 L32 29 L37 33 L46 24" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M14 43 Q22 36 32 43 Q42 36 50 43" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /></svg>
|
||||
|
After Width: | Height: | Size: 762 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><path d="M32 12 C25 12 20 17 20 24 C20 29 22 32 25 35 C27 37 28 39 28 42 H36 C36 39 37 37 39 35 C42 32 44 29 44 24 C44 17 39 12 32 12 Z" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="28" x2="36" y1="46" y2="46" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="29" x2="35" y1="50" y2="50" /><path d="M29 26 L32 29 L36 23" fill="none" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="24" x2="21" y1="14" y2="10" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="10" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="40" x2="43" y1="14" y2="10" /></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><circle cx="23" cy="21" fill="none" r="5" stroke="#08264D" stroke-width="3.2" /><circle cx="41" cy="21" fill="none" r="5" stroke="#08264D" stroke-width="3.2" /><path d="M17.0 40 V40 Q17.0 30 23 30 Q29.0 30 29.0 40 V40" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M35.0 40 V40 Q35.0 30 41 30 Q47.0 30 47.0 40 V40" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M27 13 L32 8 L37 13 L32 18 Z" fill="none" stroke="#397D0D" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="18" x2="46" y1="49" y2="49" /></svg>
|
||||
|
After Width: | Height: | Size: 942 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Vielseitigkeit</title><path d="M5 20 L32 6 L59 20 L32 34 Z" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 30 L5 34 L32 48 L59 34 L52 30" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 44 L5 48 L32 62 L59 48 L52 44" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 532 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<svg baseProfile="full" height="64" version="1.1" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><path d="M32 10 L46 15 L52 28 L46 41 L32 46 L18 41 L12 28 L18 15 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="18" y2="31" /><circle cx="32" cy="37" fill="#397D0D" r="1.9" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="19" x2="16" y1="10" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="7" y2="2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="45" x2="48" y1="10" y2="5" /></svg>
|
||||
|
After Width: | Height: | Size: 841 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Zivilcourage</title><circle cx="23" cy="13" r="7" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 56 L7 35 Q12 22 22 22 Q28 22 33 29 L42 35 Q45 39 41 40 L29 34 L18 44 L20 56 M18 44 L15 57" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="52" cy="33" r="6" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M37 57 L40 46 Q45 41 52 42 Q60 45 61 57 M40 46 Q34 40 30 39" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 14 L45 8 M49 19 L54 14" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 772 B |
@@ -209,6 +209,8 @@ ## 9. Rollback und Datenformat (wichtig vor dem Merge nach `main`)
|
||||
| Iteration 1 (Widget-Registry ohne Abschnitte) | zeigen alle Widgets untereinander; Raster, Flächen, Hintergrundbilder, Trenner und Untermenüs entfallen | darstellbar, aber **nicht gleichwertig** |
|
||||
| Stand vor der Widget-Registry (derzeitiger Stand `main`/Prod) | `blocks` liegt im Hüllenformat vor, das dieser Code nicht lesen kann: Fehler auf genau diesen Seiten | **nicht sicher** |
|
||||
|
||||
**Ausgeblendete Abschnitte und Sprungmarken.** Ein Programmstand vor `hidden` kennt das Feld nicht: Nach einem Code-Rollback erscheinen ausgeblendete Abschnitte wieder auf der Website, und Menüeinträge mit Sprungmarke führen zum Seitenanfang (die Spalte `navigation_items.anchor` bleibt unberührt). Vor einem Rollback ausgeblendete Abschnitte also prüfen (`cms:revert-published` setzt veröffentlichte Seiten zurück).
|
||||
|
||||
**Wiederherstellungsweg** (vor dem Code-Rollback, solange der neue Code läuft):
|
||||
|
||||
1. Probelauf: `php artisan cms:revert-published --before="<Zeitpunkt des Deployments>"` listet jede veröffentlichte Seite, deren Revision danach entstand, und die Revision, auf die zurückgesetzt würde.
|
||||
@@ -252,6 +254,16 @@ ## 11. Abschnitte und Plätze
|
||||
"slots": [{"id": "…", "type": "cards", "v": 1, "…": "…"}, null]}
|
||||
```
|
||||
|
||||
**Name, Sprungmarke und Ausblenden (optional, abwärtskompatibel).** Ein Abschnitt kann zusätzlich `name`, `anchor` und `hidden` tragen; fehlen sie (ältere Revisionen), gelten „kein Name“, „keine Sprungmarke“, „sichtbar“.
|
||||
|
||||
- `name`: interner Name zur Orientierung (höchstens 80 Zeichen). Er steht im Seitenaufbau und in der Linkauswahl und erscheint **nie** auf der Website.
|
||||
- `anchor`: Sprungmarke (Kleinbuchstaben, Ziffern, einzelne Bindestriche, höchstens 60 Zeichen), je Seite eindeutig, ohne reservierte Kennungen (`inhalt`, `main`, `top`, `site-nav`, `fuss-themen`, `mb-account-menu`, Vorsilbe `bereich-`). Der Renderer gibt sie als `id` des Abschnitts aus; ohne Sprungmarke bleibt `bereich-<Kennung>`. Der Versatz zur festen Kopfzeile kommt aus `scroll-padding-top` (`resources/css/base.css`). Ein Link „#marke“ gilt auf derselben Seite, „/pfad#marke“ von anderen Seiten, „https://Adresse/pfad#marke“ von außen.
|
||||
- `hidden`: `true` blendet den Abschnitt auf der Website aus. Er zählt weder für die Hauptüberschrift (H1) noch für Trenner; Bilder und Medien bleiben erfasst, damit sie nicht als ungenutzt gelten. Die Seitenvorschau zeigt an seiner Stelle einen schmalen Hinweis. `pageTitle()` übergeht ausgeblendete Abschnitte.
|
||||
- Fehler: `sections.N.name`, `sections.N.anchor` (Form, reserviert, doppelt). Ein kopierter Abschnitt gibt seine Sprungmarke ab (Namen erhalten „(Kopie)“), damit die Seite speicherbar bleibt.
|
||||
- Im Seitenaufbau stehen die Felder am Abschnitt („Name, Sprungmarke und Sichtbarkeit“); die Kopfzeile des Abschnitts zeigt Name, `#marke` und „Ausgeblendet“.
|
||||
|
||||
**Linkziele.** `SafeUrl` erlaubt Seitenpfade (auch mit `#marke`), `#marke` (nur diese Seite) und http(s)-Adressen. Alle Linkfelder der Widgets (Schaltflächen von Einstieg und Bild-Text, Handlungsaufforderung, Karten, Merkmale) sind `WidgetsSupportinkfield`: ein Textfeld mit Linksymbol, das den Dialog „Interne Seite wählen“ (`ChoosesLinkTargets`, `filament.cms.link-picker`) öffnet. Schritt 1 wählt die Seite (oder „Diese Seite“) mit Veröffentlichungszustand, Schritt 2 eine Sprungmarke; nicht veröffentlichte Marken und ausgeblendete Abschnitte sind gekennzeichnet. Die Marken der bearbeiteten Seite stammen aus dem Formular (auch ungespeicherte). Der Dialog schreibt nur die Adresse in das Feld. Im formatierten Text (Fließtext, Einleitung der Überschrift, Bild-Text) setzt das Werkzeug „Interne Seite oder Sprungmarke verlinken“ (`InternalLinkPlugin`) den Link am markierten Text. Menüeinträge: Spalte `navigation_items.anchor`, zweiter Schritt in „Ziel ändern“; der Link bleibt an die Zielseite gebunden.
|
||||
|
||||
| Raster | Einheiten | Desktop (Abschnitt ab 60 rem) | Tablet (40–60 rem) | Smartphone |
|
||||
|---|---|---|---|---|
|
||||
| `u4` | 4 | volle Breite | volle Breite | volle Breite |
|
||||
|
||||
@@ -14,6 +14,8 @@ ## 1. Inhalt (Stand 21.11.2026 abends: 22 Commits seit `main`)
|
||||
| Medienkarte: Film nur mit Website-Datei | Ein Medium ohne Fassung (z. B. Teaser) ist auf der Medienkarte wählbar und erscheint öffentlich, sobald die Datei für die Website freigegeben ist (ohne Programmseite, ohne Aktion). Keine Migration | Claude |
|
||||
| Karte ohne Texte | Medien- und Programmkarte: Einstellung „Texte auf der Karte“ (Ausblenden) zeigt nur Bild oder Video; der Titel bleibt für Hilfstechnik. Keine Migration | Claude |
|
||||
| Reiter „Darstellung“ gegliedert | Aufbau, Gruppen je Widget, Erklärungen im (i), Einzelschalter für Texte verschwinden bei „Texte auf der Karte: Ausblenden“; Bezeichnungen vereinheitlicht. Keine Migration, gespeicherte Werte unverändert | Claude |
|
||||
| Abschnitte: Name, Sprungmarke, Ausblenden | Abschnitte lassen sich benennen (nur zur Orientierung), als Sprungmarke nutzen (Link „#marke“, „/pfad#marke“, von außen „Adresse#marke“) und für die Website ausblenden; Anzeige im Seitenaufbau. Keine Migration (neue optionale Felder in `sections`). **Rollback:** ältere Stände kennen „ausgeblendet“ nicht und zeigen solche Abschnitte wieder | Claude |
|
||||
| Interne Links wählen | Alle Linkfelder der Widgets und das Werkzeug im formatierten Text bieten einen Dialog für Seiten und Sprungmarken; Menüeinträge können auf eine Sprungmarke zeigen. Migration `2026_12_02_100000_add_anchor_to_navigation_items` (additiv) | Claude |
|
||||
| Hero mit Video | Der Einstieg (Variante Foto mit Textfläche) spielt auf Wunsch ein freigegebenes Video stumm auf der Fläche des Fotos ab, mit Schaltfläche zum Anhalten; Foto als Rückfall (ADR-43 Nachtrag). Keine Migration | Claude |
|
||||
| Website-Datei eines Films | Ablage der Datei eines eigenständigen Präsentationsmediums über die Warteschlange, nachträgliches Hochladen am Medium (Behebung: der Web-Prozess darf `derived/` nicht schreiben) | Lars (anderer Rechner) |
|
||||
| Medienmanager | „Medium löschen“ erreicht Standbilder und übernommene CMS-Bilder (Fremdschlüssel gelockert) | Claude |
|
||||
@@ -44,6 +46,7 @@ ## 3. Migrationen (Prod steht bei der 32. Migration `2026_11_20_200000_editorial
|
||||
| `2026_11_21_130000_add_shop_foundation` | Spalten an `offers`, `orders`, `order_lines`, `acquisitions`, neue Tabelle `memberships`, Rückrechnung bestehender Bestellungen | additiv; Daten werden berechnet, nicht gelöscht |
|
||||
| `2026_11_21_130000_allow_deleting_media_with_stills_and_aliases` | lockert zwei Fremdschlüssel (`film_still_sources`, `website_media_aliases`) | ja, lockert nur |
|
||||
| `2026_11_21_140000_create_composition_still_sources` | neue Tabelle | ja |
|
||||
| `2026_12_02_100000_add_anchor_to_navigation_items` | nullable Spalte `anchor` an `navigation_items` | ja, additiv (ältere Stände ignorieren sie; der Menülink führt dann zum Seitenanfang) |
|
||||
|
||||
Keine bestehende Migration wurde geändert. Verglichen mit der Migrationstabelle von Prod (lesend): Prod hat 32 angewendet, `develop` 37 Dateien, **genau diese fünf sind ausstehend**, nichts auf Prod fehlt in `develop`. Prod hat 0 Bestellungen; die Rückrechnung in `add_shop_foundation` hat dort nichts zu tun. Der Rollback des Deploy-Skripts setzt nur den Code zurück, nicht die Datenbank; die neuen Tabellen und gelockerten Schlüssel stören älteren Code nicht.
|
||||
|
||||
|
||||
@@ -200,3 +200,14 @@ .section-divider-accent span {
|
||||
border-radius: 5px;
|
||||
background: var(--lf-yellow);
|
||||
}
|
||||
|
||||
/* Vorschau: Platzhalter für einen ausgeblendeten Abschnitt (die Website zeigt ihn nie). */
|
||||
.section-hidden-note {
|
||||
margin: var(--space-3, 0.75rem) auto;
|
||||
max-inline-size: 60rem;
|
||||
padding: 0.5rem 0.875rem;
|
||||
border: 1px dashed currentColor;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
@@ -17,6 +17,18 @@
|
||||
"w": 55.7,
|
||||
"h": 51.2
|
||||
},
|
||||
"alltagsnah": {
|
||||
"x": 2.4,
|
||||
"y": 5.0,
|
||||
"w": 60.7,
|
||||
"h": 49.6
|
||||
},
|
||||
"altersgerecht": {
|
||||
"x": 3.4,
|
||||
"y": 2.4,
|
||||
"w": 60.2,
|
||||
"h": 55.2
|
||||
},
|
||||
"arbeitsblatt": {
|
||||
"x": 11.4,
|
||||
"y": 4.4,
|
||||
@@ -29,6 +41,12 @@
|
||||
"w": 44,
|
||||
"h": 49.5
|
||||
},
|
||||
"ausgrenzung": {
|
||||
"x": 1.4,
|
||||
"y": 11.4,
|
||||
"w": 60.2,
|
||||
"h": 43.2
|
||||
},
|
||||
"beobachtung": {
|
||||
"x": 2.4,
|
||||
"y": 15.9,
|
||||
@@ -89,6 +107,12 @@
|
||||
"w": 69.2,
|
||||
"h": 65.2
|
||||
},
|
||||
"eltern": {
|
||||
"x": 2.4,
|
||||
"y": 0.4,
|
||||
"w": 59.2,
|
||||
"h": 54.2
|
||||
},
|
||||
"filmklappe": {
|
||||
"x": 4.8,
|
||||
"y": 6.3,
|
||||
@@ -119,6 +143,12 @@
|
||||
"w": 56.2,
|
||||
"h": 50.2
|
||||
},
|
||||
"freundschaft": {
|
||||
"x": 3.4,
|
||||
"y": 1.4,
|
||||
"w": 59.2,
|
||||
"h": 53.2
|
||||
},
|
||||
"geeignet": {
|
||||
"x": 6.4,
|
||||
"y": 6.4,
|
||||
@@ -149,12 +179,24 @@
|
||||
"w": 232.6,
|
||||
"h": 29.6
|
||||
},
|
||||
"geschuetzt": {
|
||||
"x": 2.1,
|
||||
"y": 1.4,
|
||||
"w": 59.8,
|
||||
"h": 59.2
|
||||
},
|
||||
"gespraech": {
|
||||
"x": 3.4,
|
||||
"y": 8.4,
|
||||
"w": 57.2,
|
||||
"h": 50.2
|
||||
},
|
||||
"gewaltschutztrainer": {
|
||||
"x": 1.4,
|
||||
"y": 4.4,
|
||||
"w": 61.2,
|
||||
"h": 53.3
|
||||
},
|
||||
"grenzen-erkennen": {
|
||||
"x": 4.4,
|
||||
"y": 4.4,
|
||||
@@ -167,6 +209,12 @@
|
||||
"w": 80.2,
|
||||
"h": 54.1
|
||||
},
|
||||
"gruppen": {
|
||||
"x": 1.4,
|
||||
"y": 5.4,
|
||||
"w": 61.2,
|
||||
"h": 46.2
|
||||
},
|
||||
"gruppenuebung": {
|
||||
"x": 3.4,
|
||||
"y": 7.4,
|
||||
@@ -191,6 +239,18 @@
|
||||
"w": 51.2,
|
||||
"h": 48.2
|
||||
},
|
||||
"hinweis": {
|
||||
"x": 12.4,
|
||||
"y": 6.4,
|
||||
"w": 44.2,
|
||||
"h": 42.2
|
||||
},
|
||||
"information": {
|
||||
"x": 15.4,
|
||||
"y": 10.4,
|
||||
"w": 38.2,
|
||||
"h": 34.2
|
||||
},
|
||||
"kinderreaktion": {
|
||||
"x": 3.4,
|
||||
"y": 3.4,
|
||||
@@ -203,6 +263,12 @@
|
||||
"w": 45.2,
|
||||
"h": 53.2
|
||||
},
|
||||
"kita-kindergarten": {
|
||||
"x": 8.4,
|
||||
"y": 7.4,
|
||||
"w": 47.2,
|
||||
"h": 42.2
|
||||
},
|
||||
"koerpersprache": {
|
||||
"x": 6.4,
|
||||
"y": 3.4,
|
||||
@@ -239,6 +305,12 @@
|
||||
"w": 54.6,
|
||||
"h": 73.6
|
||||
},
|
||||
"merke": {
|
||||
"x": 9.8,
|
||||
"y": 15.4,
|
||||
"w": 44.4,
|
||||
"h": 25.2
|
||||
},
|
||||
"merksatz": {
|
||||
"x": 3.4,
|
||||
"y": 3.4,
|
||||
@@ -251,12 +323,24 @@
|
||||
"w": 52.2,
|
||||
"h": 47.3
|
||||
},
|
||||
"mobbing": {
|
||||
"x": 1.4,
|
||||
"y": 3.4,
|
||||
"w": 61.2,
|
||||
"h": 53.2
|
||||
},
|
||||
"muskelarm": {
|
||||
"x": 8.0,
|
||||
"y": 16.5,
|
||||
"w": 85.8,
|
||||
"h": 67.5
|
||||
},
|
||||
"nachhaltigkeit": {
|
||||
"x": 5.4,
|
||||
"y": 3.9,
|
||||
"w": 53.3,
|
||||
"h": 56.2
|
||||
},
|
||||
"nein-sagen": {
|
||||
"x": 5.4,
|
||||
"y": 9.4,
|
||||
@@ -269,6 +353,12 @@
|
||||
"w": 51.2,
|
||||
"h": 51.2
|
||||
},
|
||||
"oeffentliche-einrichtungen": {
|
||||
"x": 3.4,
|
||||
"y": 6.3,
|
||||
"w": 57.2,
|
||||
"h": 53.3
|
||||
},
|
||||
"paket": {
|
||||
"x": 12.7,
|
||||
"y": 12.6,
|
||||
@@ -305,6 +395,18 @@
|
||||
"w": 77.4,
|
||||
"h": 63.4
|
||||
},
|
||||
"praevention": {
|
||||
"x": 16.4,
|
||||
"y": 5.4,
|
||||
"w": 31.2,
|
||||
"h": 49.2
|
||||
},
|
||||
"praxiserprobt": {
|
||||
"x": 4.4,
|
||||
"y": 5.1,
|
||||
"w": 55.2,
|
||||
"h": 53.8
|
||||
},
|
||||
"raumaufbau": {
|
||||
"x": 5.4,
|
||||
"y": 5.4,
|
||||
@@ -317,6 +419,12 @@
|
||||
"w": 47.3,
|
||||
"h": 49.2
|
||||
},
|
||||
"relevant": {
|
||||
"x": 6.4,
|
||||
"y": 0.4,
|
||||
"w": 58.2,
|
||||
"h": 58.2
|
||||
},
|
||||
"richtige-antwort": {
|
||||
"x": 8.4,
|
||||
"y": 8.4,
|
||||
@@ -335,6 +443,12 @@
|
||||
"w": 59.2,
|
||||
"h": 57.2
|
||||
},
|
||||
"schulen": {
|
||||
"x": 3.4,
|
||||
"y": 1.4,
|
||||
"w": 57.2,
|
||||
"h": 53.2
|
||||
},
|
||||
"schutzschild": {
|
||||
"x": 16.7,
|
||||
"y": 9.7,
|
||||
@@ -371,6 +485,18 @@
|
||||
"w": 39.4,
|
||||
"h": 54.4
|
||||
},
|
||||
"teamwork": {
|
||||
"x": 11.6,
|
||||
"y": 6.6,
|
||||
"w": 40.8,
|
||||
"h": 38.4
|
||||
},
|
||||
"tipp": {
|
||||
"x": 18.4,
|
||||
"y": 3.4,
|
||||
"w": 27.2,
|
||||
"h": 48.2
|
||||
},
|
||||
"trainerhinweis": {
|
||||
"x": 8.4,
|
||||
"y": 5.4,
|
||||
@@ -395,12 +521,24 @@
|
||||
"w": 55.2,
|
||||
"h": 55.2
|
||||
},
|
||||
"verein": {
|
||||
"x": 15.4,
|
||||
"y": 6.4,
|
||||
"w": 33.2,
|
||||
"h": 44.2
|
||||
},
|
||||
"vertrauensperson": {
|
||||
"x": 4.4,
|
||||
"y": 4.3,
|
||||
"w": 55.2,
|
||||
"h": 54.3
|
||||
},
|
||||
"vielseitigkeit": {
|
||||
"x": 3.4,
|
||||
"y": 4.4,
|
||||
"w": 57.2,
|
||||
"h": 59.2
|
||||
},
|
||||
"visualisierung": {
|
||||
"x": 5.4,
|
||||
"y": 6.4,
|
||||
@@ -419,6 +557,12 @@
|
||||
"w": 50.2,
|
||||
"h": 51.2
|
||||
},
|
||||
"wichtig": {
|
||||
"x": 10.4,
|
||||
"y": 0.4,
|
||||
"w": 43.2,
|
||||
"h": 47.2
|
||||
},
|
||||
"wiedergabe": {
|
||||
"x": 5.4,
|
||||
"y": 11.4,
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"Vorbereitung und Leitung",
|
||||
"Schutz und Grenzen",
|
||||
"Gefühle und Verhalten",
|
||||
"Hinweise und Bewertung"
|
||||
"Hinweise und Bewertung",
|
||||
"Zielgruppen und Einrichtungen"
|
||||
],
|
||||
"symbole": {
|
||||
"ablauf": {
|
||||
@@ -24,6 +25,16 @@
|
||||
"gruppe": 4,
|
||||
"suche": "notfall warnung"
|
||||
},
|
||||
"alltagsnah": {
|
||||
"titel": "Alltagsnah",
|
||||
"gruppe": 6,
|
||||
"suche": "praxisnah lebensnah zuhause haus baum"
|
||||
},
|
||||
"altersgerecht": {
|
||||
"titel": "Altersgerecht",
|
||||
"gruppe": 6,
|
||||
"suche": "kinder alter passend entwicklungsgerecht"
|
||||
},
|
||||
"arbeitsblatt": {
|
||||
"titel": "Arbeitsblatt",
|
||||
"gruppe": 0,
|
||||
@@ -34,6 +45,11 @@
|
||||
"gruppe": 6,
|
||||
"suche": "hervorhebung wichtig impuls"
|
||||
},
|
||||
"ausgrenzung": {
|
||||
"titel": "Ausgrenzung",
|
||||
"gruppe": 5,
|
||||
"suche": "ausschließen außenseiter alleine nicht dazugehören"
|
||||
},
|
||||
"beobachtung": {
|
||||
"titel": "Beobachtung",
|
||||
"gruppe": 2,
|
||||
@@ -84,6 +100,11 @@
|
||||
"gruppe": 0,
|
||||
"suche": "herunterladen pdf speichern datei"
|
||||
},
|
||||
"eltern": {
|
||||
"titel": "Eltern",
|
||||
"gruppe": 7,
|
||||
"suche": "familie erwachsene kind begleitung"
|
||||
},
|
||||
"filmklappe": {
|
||||
"titel": "Filmklappe",
|
||||
"gruppe": 1,
|
||||
@@ -109,6 +130,11 @@
|
||||
"gruppe": 4,
|
||||
"suche": "teilnahme selbst wählen einverständnis"
|
||||
},
|
||||
"freundschaft": {
|
||||
"titel": "Freundschaft",
|
||||
"gruppe": 5,
|
||||
"suche": "freunde befreundet miteinander"
|
||||
},
|
||||
"geeignet": {
|
||||
"titel": "Geeignet",
|
||||
"gruppe": 6,
|
||||
@@ -134,11 +160,21 @@
|
||||
"angeboten": false,
|
||||
"hinweis": "Pinselstrich unter der Überschrift (eigene Einstellung)"
|
||||
},
|
||||
"geschuetzt": {
|
||||
"titel": "Geschützt",
|
||||
"gruppe": 4,
|
||||
"suche": "schutz behütet sicher hände"
|
||||
},
|
||||
"gespraech": {
|
||||
"titel": "Gespräch",
|
||||
"gruppe": 2,
|
||||
"suche": "austausch sprechen"
|
||||
},
|
||||
"gewaltschutztrainer": {
|
||||
"titel": "Gewaltschutztrainer",
|
||||
"gruppe": 3,
|
||||
"suche": "trainer trainerin leitung schutz kursleitung"
|
||||
},
|
||||
"grenzen-erkennen": {
|
||||
"titel": "Grenzen erkennen",
|
||||
"gruppe": 4,
|
||||
@@ -149,6 +185,11 @@
|
||||
"gruppe": 2,
|
||||
"suche": "gemeinsam personen"
|
||||
},
|
||||
"gruppen": {
|
||||
"titel": "Gruppen",
|
||||
"gruppe": 7,
|
||||
"suche": "team klasse mehrere personen"
|
||||
},
|
||||
"gruppenuebung": {
|
||||
"titel": "Gruppenübung",
|
||||
"gruppe": 2,
|
||||
@@ -169,6 +210,16 @@
|
||||
"gruppe": 4,
|
||||
"suche": "unterstützung ansprechen"
|
||||
},
|
||||
"hinweis": {
|
||||
"titel": "Hinweis",
|
||||
"gruppe": 6,
|
||||
"suche": "sprechblase anmerkung notiz mitteilung"
|
||||
},
|
||||
"information": {
|
||||
"titel": "Information",
|
||||
"gruppe": 6,
|
||||
"suche": "info wissen erklärung"
|
||||
},
|
||||
"kinderreaktion": {
|
||||
"titel": "Unerwartete Kinderreaktion",
|
||||
"gruppe": 5,
|
||||
@@ -179,6 +230,11 @@
|
||||
"gruppe": 4,
|
||||
"suche": "kinderschutz wohlergehen"
|
||||
},
|
||||
"kita-kindergarten": {
|
||||
"titel": "Kita, Kindergarten",
|
||||
"gruppe": 7,
|
||||
"suche": "kindertagesstätte vorschule haus einrichtung"
|
||||
},
|
||||
"koerpersprache": {
|
||||
"titel": "Körpersprache",
|
||||
"gruppe": 5,
|
||||
@@ -209,6 +265,11 @@
|
||||
"gruppe": 0,
|
||||
"suche": "zusammenfassung nachlesen merkzettel"
|
||||
},
|
||||
"merke": {
|
||||
"titel": "Merke",
|
||||
"gruppe": 6,
|
||||
"suche": "merken lesezeichen wichtig behalten"
|
||||
},
|
||||
"merksatz": {
|
||||
"titel": "Merksatz",
|
||||
"gruppe": 0,
|
||||
@@ -219,11 +280,21 @@
|
||||
"gruppe": 2,
|
||||
"suche": "frage nachdenken impuls"
|
||||
},
|
||||
"mobbing": {
|
||||
"titel": "Mobbing",
|
||||
"gruppe": 5,
|
||||
"suche": "ausgrenzen schikane hänseln gruppe"
|
||||
},
|
||||
"muskelarm": {
|
||||
"titel": "Starker Arm",
|
||||
"gruppe": 5,
|
||||
"suche": "stärke mut selbstvertrauen"
|
||||
},
|
||||
"nachhaltigkeit": {
|
||||
"titel": "Nachhaltigkeit",
|
||||
"gruppe": 6,
|
||||
"suche": "dauerhaft kreislauf blatt wirkung"
|
||||
},
|
||||
"nein-sagen": {
|
||||
"titel": "Nein sagen",
|
||||
"gruppe": 4,
|
||||
@@ -234,6 +305,11 @@
|
||||
"gruppe": 6,
|
||||
"suche": "falsch kreuz negativ"
|
||||
},
|
||||
"oeffentliche-einrichtungen": {
|
||||
"titel": "Öffentliche Einrichtungen",
|
||||
"gruppe": 7,
|
||||
"suche": "behörde amt institution gebäude säulen"
|
||||
},
|
||||
"paket": {
|
||||
"titel": "Paket",
|
||||
"gruppe": 0,
|
||||
@@ -264,6 +340,16 @@
|
||||
"gruppe": 1,
|
||||
"suche": "start dreieck"
|
||||
},
|
||||
"praevention": {
|
||||
"titel": "Prävention",
|
||||
"gruppe": 4,
|
||||
"suche": "vorbeugung vorsorge schild"
|
||||
},
|
||||
"praxiserprobt": {
|
||||
"titel": "Praxiserprobt",
|
||||
"gruppe": 6,
|
||||
"suche": "bewährt geprüft siegel qualität"
|
||||
},
|
||||
"raumaufbau": {
|
||||
"titel": "Raumaufbau",
|
||||
"gruppe": 3,
|
||||
@@ -274,6 +360,11 @@
|
||||
"gruppe": 2,
|
||||
"suche": "nachbesprechung betrachten"
|
||||
},
|
||||
"relevant": {
|
||||
"titel": "Relevant",
|
||||
"gruppe": 6,
|
||||
"suche": "zielscheibe treffer ziel passend"
|
||||
},
|
||||
"richtige-antwort": {
|
||||
"titel": "Richtige Antwort",
|
||||
"gruppe": 6,
|
||||
@@ -289,6 +380,11 @@
|
||||
"gruppe": 3,
|
||||
"suche": "aufgaben zuweisen"
|
||||
},
|
||||
"schulen": {
|
||||
"titel": "Schulen",
|
||||
"gruppe": 7,
|
||||
"suche": "schule schulgebäude klasse unterricht"
|
||||
},
|
||||
"schutzschild": {
|
||||
"titel": "Schutzschild",
|
||||
"gruppe": 4,
|
||||
@@ -319,6 +415,16 @@
|
||||
"gruppe": 4,
|
||||
"suche": "anhalten signal beenden"
|
||||
},
|
||||
"teamwork": {
|
||||
"titel": "Teamwork",
|
||||
"gruppe": 5,
|
||||
"suche": "zusammenarbeit gemeinsam team miteinander"
|
||||
},
|
||||
"tipp": {
|
||||
"titel": "Tipp",
|
||||
"gruppe": 6,
|
||||
"suche": "glühbirne idee empfehlung"
|
||||
},
|
||||
"trainerhinweis": {
|
||||
"titel": "Trainerhinweis",
|
||||
"gruppe": 3,
|
||||
@@ -339,11 +445,21 @@
|
||||
"gruppe": 2,
|
||||
"suche": "abwandlung alternative übungsform"
|
||||
},
|
||||
"verein": {
|
||||
"titel": "Verein",
|
||||
"gruppe": 7,
|
||||
"suche": "sport vereine gemeinschaft"
|
||||
},
|
||||
"vertrauensperson": {
|
||||
"titel": "Vertrauensperson",
|
||||
"gruppe": 4,
|
||||
"suche": "bezugsperson verbundenheit fürsorge"
|
||||
},
|
||||
"vielseitigkeit": {
|
||||
"titel": "Vielseitigkeit",
|
||||
"gruppe": 6,
|
||||
"suche": "vielfalt ebenen abwechslung"
|
||||
},
|
||||
"visualisierung": {
|
||||
"titel": "Visualisierung",
|
||||
"gruppe": 2,
|
||||
@@ -359,6 +475,11 @@
|
||||
"gruppe": 4,
|
||||
"suche": "entfernen verlassen"
|
||||
},
|
||||
"wichtig": {
|
||||
"titel": "Wichtig",
|
||||
"gruppe": 6,
|
||||
"suche": "ausrufezeichen achtung warnung"
|
||||
},
|
||||
"wiedergabe": {
|
||||
"titel": "Wiedergabe",
|
||||
"gruppe": 1,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Alltagsnah</title><path d="M32 22 Q33 15 39 15 Q40 5 49 7 Q57 8 57 17 Q64 20 60 30 Q57 36 50 34 M49 23 V53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 32 L24 13 L44 32 M8 29 V53 H40 V29 M19 53 V38 H29 V53 M4 53 H59" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 474 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Altersgerecht</title><g fill="none" stroke="#08264D" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 31 C11 38 16 42 21 42 C27 42 32 37 31 30 L30 27"/><circle cx="46" cy="32" r="9"/><path d="M37 28 C34 22 32 25 30 29 M55 28 C58 22 60 25 62 29"/><path d="M6 56 C6 48 12 43 20.5 43 C28 43 33 49 33 56 C33 49 38 43 46 43 C54 43 60 49 60 56"/><path d="M19 36 Q21 38 24 36 M43 36 Q46 38 49 36" stroke-width="1.5"/></g><g fill="none" stroke="#397D0D" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 30 C11 23 16 19 21 19 C26 19 30 23 31 27 M5 31 L31 27"/></g><g fill="none" stroke="#FFCD00" stroke-width="3.2" stroke-linecap="round"><path d="M27 13 L23 8 M32 11 V4 M38 13 L42 8"/></g></svg>
|
||||
|
After Width: | Height: | Size: 837 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Ausgrenzung</title><circle cx="11" cy="23" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="25" cy="23" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 49 V41 Q3 31 11 31 Q20 31 20 41 V49 M20 41 Q20 31 25 31 Q33 31 33 41 V49" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M41 13 Q31 30 39 53" stroke="#08264D" stroke-width="3.2" fill="none" stroke-dasharray="4 5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="51" cy="33" r="5.5" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M42 53 Q42 42 51 42 Q60 42 60 53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 829 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Eltern</title><circle cx="15" cy="19" r="7" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="49" cy="19" r="7" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M4 48 V42 C4 27 24 27 26 37 M60 48 V42 C60 27 40 27 38 37" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="32" cy="32" r="5.5" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M21 53 V51 C21 35 43 35 43 51 V53" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 8 L21 4 M32 7 V2 M40 8 L43 4" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 793 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Freundschaft</title><circle cx="20" cy="23" fill="none" r="9" stroke="#08264D" stroke-width="3.2" /><circle cx="43" cy="23" fill="none" r="9" stroke="#08264D" stroke-width="3.2" /><circle cx="17" cy="21" fill="#08264D" r="1.2" /><circle cx="23" cy="21" fill="#08264D" r="1.2" /><circle cx="40" cy="21" fill="#08264D" r="1.2" /><circle cx="46" cy="21" fill="#08264D" r="1.2" /><path d="M16 27 Q20 30.2 24 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9" /><path d="M39 27 Q43 30.2 47 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9" /><path d="M5 53 Q5 40 14 36" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><path d="M54 43 Q60 47 60 53" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><path d="M30 53 L27 40 Q29 36 35 35" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M50 34 Q60 36 57 42 Q54 47 48 43 Q45 41 48 36" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="51" x2="53" y1="8" y2="3" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="56" x2="61" y1="12" y2="8" /></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Geschützt</title><circle cx="32" cy="23" r="6" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M21 39 Q23 30 32 30 Q41 30 43 39" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M17 59 V53 L7 44 L4 33 Q3 29 6 28 Q10 27 11 32 L13 41 L23 49 M27 59 V51 Q27 46 22 42 L16 37 Q12 36 13 41 L20 47 M47 59 V53 L57 44 L60 33 Q61 29 58 28 Q54 27 53 32 L51 41 L41 49 M37 59 V51 Q37 46 42 42 L48 37 Q52 36 51 41 L44 47" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M23 12 L19 7 M32 10 V3 M41 12 L45 7" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 809 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Gewaltschutztrainer</title><circle cx="17" cy="15" r="8" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 53 V39 Q3 28 12 25 M24 25 Q28 26 30 29 M35 26 Q44 24 49 20 Q54 24 61 26 V37 Q60 49 49 56 Q37 49 35 37 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 26 L17 40 L24 26 M17 45 V50" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="17" cy="42" r="3" stroke="#397D0D" stroke-width="3.2" fill="none"/><path d="M43 39 V34 Q43 32 45 32 V38 V29 Q47 27 48 29 V37 V27 Q50 25 51 28 V37 V30 Q53 28 54 31 V39 Q54 46 49 46 Q44 46 41 40 Q40 37 43 39 Z" stroke="#397D0D" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M51 12 L53 6 M57 15 L61 11" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Gruppen</title><circle cx="32" cy="14" r="7" stroke="#397D0D" stroke-width="3.2" fill="none"/><circle cx="12" cy="22" r="6" stroke="#08264D" stroke-width="3.2" fill="none"/><circle cx="52" cy="22" r="6" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M3 48 Q3 32 18 32 M61 48 Q61 32 46 32 M17 50 V44 C17 24 47 24 47 44 V50 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 529 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Hinweis</title><path d="M14 14 H50 V38 H29 L20 47 V38 H14 Z" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><circle cx="24" cy="26" fill="#397D0D" r="2.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="31" x2="43" y1="26" y2="26" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="31" x2="38" y1="32" y2="32" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="46" x2="50" y1="12" y2="8" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="50" x2="55" y1="18" y2="17" /></svg>
|
||||
|
After Width: | Height: | Size: 699 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Information</title><circle cx="32" cy="28" fill="none" r="15" stroke="#08264D" stroke-width="3.2" /><circle cx="32" cy="21" fill="#397D0D" r="1.8" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="27" y2="38" /><line stroke="#08264D" stroke-linecap="round" stroke-width="3.2" x1="28" x2="36" y1="42" y2="42" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="43" x2="48" y1="16" y2="12" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="46" x2="52" y1="22" y2="21" /></svg>
|
||||
|
After Width: | Height: | Size: 642 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Kita kindergarten</title><rect fill="none" height="20" rx="2" ry="2" stroke="#08264D" stroke-width="3.2" width="40" x="12" y="28" /><path d="M10 28 L32 15 L54 28" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><rect fill="none" height="12" stroke="#397D0D" stroke-width="3.2" width="8" x="28" y="36" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="19" x2="24" y1="40" y2="40" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="18" x2="24" y1="35" y2="35" /><path d="M40 38 Q42 32 47 35" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="44" x2="47" y1="14" y2="9" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="49" x2="53" y1="17" y2="15" /></svg>
|
||||
|
After Width: | Height: | Size: 947 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Merke</title><path d="M12 22 Q32 14 52 22" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M14 27 Q32 20 50 27" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M16 32 Q32 26 48 32" fill="none" opacity="0.95" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.4" /><path d="M27 17 L37 17 L37 39 L32 34 L27 39 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /></svg>
|
||||
|
After Width: | Height: | Size: 657 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Mobbing</title><circle cx="13" cy="19" fill="none" r="6.5" stroke="#08264D" stroke-width="3.2" /><circle cx="51" cy="19" fill="none" r="6.5" stroke="#08264D" stroke-width="3.2" /><path d="M3 36 Q4 28 13 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-width="3.2" /><path d="M61 36 Q60 28 51 27" fill="none" stroke="#08264D" stroke-linecap="round" stroke-width="3.2" /><circle cx="32" cy="32" fill="none" r="8" stroke="#08264D" stroke-width="3.2" /><circle cx="29" cy="30" fill="#08264D" r="1.2" /><circle cx="35" cy="30" fill="#08264D" r="1.2" /><path d="M28 36.8 Q32 33.8 36 36.8" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" /><path d="M19 55 Q22 43 32 43 Q42 43 45 55" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="28" x2="26" y1="12" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="34" x2="37" y1="12" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="39" x2="45" y1="16" y2="12" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="16" x2="21" y1="36" y2="40" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="13" x2="20" y1="45" y2="45" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="48" x2="43" y1="36" y2="40" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="51" x2="44" y1="45" y2="45" /></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Nachhaltigkeit</title><path d="M7 31 A25 25 0 0 1 53 17 M53 9 V18 L44 15 M57 32 A25 25 0 0 1 11 47 M11 55 V46 L20 49" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 41 C15 27 35 28 43 19 C46 37 35 48 24 41 Z M22 46 Q25 35 35 30" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 484 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Öffentliche Einrichtungen</title><path d="M5 23 L32 8 L59 23 Q59 25 56 25 H8 Q5 25 5 23 Z M10 29 H54 M12 49 H52 M10 53 H54 M14 29 V49 M21 29 V49 M28 29 V49 M36 29 V49 M43 29 V49 M50 29 V49" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 58 H59" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 500 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Praevention</title><path d="M18 14 L46 20 V34 Q46 47 32 53 Q18 47 18 34 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /><path d="M24 35 L30 29 L35 34 L42 25" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="30" x2="28" y1="12" y2="7" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="36" x2="38" y1="12" y2="7" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="42" x2="46" y1="15" y2="12" /></svg>
|
||||
|
After Width: | Height: | Size: 676 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Praxiserprobt</title><path d="M33.80 9.07 L38.07 6.72 L41.95 7.98 L44.02 12.39 L46.94 14.51 L51.77 15.11 L54.17 18.42 L53.25 23.20 L54.36 26.63 L57.92 29.96 L57.92 34.04 L54.36 37.37 L53.25 40.80 L54.17 45.58 L51.77 48.89 L46.94 49.49 L44.02 51.61 L41.95 56.02 L38.07 57.28 L33.80 54.93 L30.20 54.93 L25.93 57.28 L22.05 56.02 L19.98 51.61 L17.06 49.49 L12.23 48.89 L9.83 45.58 L10.75 40.80 L9.64 37.37 L6.08 34.04 L6.08 29.96 L9.64 26.63 L10.75 23.20 L9.83 18.42 L12.23 15.11 L17.06 14.51 L19.98 12.39 L22.05 7.98 L25.93 6.72 L30.20 9.07 Z" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 32 L29 40 L44 24" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 861 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 65 65"><title>Relevant</title><path d="M42.1428 11.2486 A24 24 0 1 0 53.7514 22.8572" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M36.9443 17.7831 A16 16 0 1 0 47.2169 28.0557" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M32.0000 26.0000 A7 7 0 1 0 39.0000 33.0000" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M32 33 L51 14 M51 14 L49 8 L56 2 L57 9 L63 10 L56 17 Z" stroke="#FFCD00" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 728 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Schulen</title><path d="M5 31 L12 21 H21 L32 12 L43 21 H52 L59 31 M8 31 V53 H56 V31 M5 31 H19 M45 31 H59 M26 53 V43 Q26 40 29 40 H35 Q38 40 38 43 V53 M14 37 V40 M20 37 V40 M44 37 V40 M50 37 V40" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="32" cy="26" r="5.5" stroke="#08264D" stroke-width="3.2" fill="none"/><path d="M32 23 V26 L34 27 M32 12 L34 3 L45 4 L43 11 L33 10" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 626 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Teamwork</title><circle cx="18" cy="17" fill="none" r="4.8" stroke="#08264D" stroke-width="3.2" /><circle cx="32" cy="13" fill="none" r="4.8" stroke="#397D0D" stroke-width="3.2" /><circle cx="46" cy="17" fill="none" r="4.8" stroke="#08264D" stroke-width="3.2" /><path d="M18 24 L27 33 L32 29 L37 33 L46 24" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M14 43 Q22 36 32 43 Q42 36 50 43" fill="none" stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" /></svg>
|
||||
|
After Width: | Height: | Size: 617 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Tipp</title><path d="M32 12 C25 12 20 17 20 24 C20 29 22 32 25 35 C27 37 28 39 28 42 H36 C36 39 37 37 39 35 C42 32 44 29 44 24 C44 17 39 12 32 12 Z" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="28" x2="36" y1="46" y2="46" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="29" x2="35" y1="50" y2="50" /><path d="M29 26 L32 29 L36 23" fill="none" stroke="#FFCD00" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="24" x2="21" y1="14" y2="10" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="10" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="40" x2="43" y1="14" y2="10" /></svg>
|
||||
|
After Width: | Height: | Size: 965 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Verein</title><circle cx="23" cy="21" fill="none" r="5" stroke="#08264D" stroke-width="3.2" /><circle cx="41" cy="21" fill="none" r="5" stroke="#08264D" stroke-width="3.2" /><path d="M17.0 40 V40 Q17.0 30 23 30 Q29.0 30 29.0 40 V40" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M35.0 40 V40 Q35.0 30 41 30 Q47.0 30 47.0 40 V40" fill="none" stroke="#08264D" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.2" /><path d="M27 13 L32 8 L37 13 L32 18 Z" fill="none" stroke="#397D0D" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="18" x2="46" y1="49" y2="49" /></svg>
|
||||
|
After Width: | Height: | Size: 795 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>Vielseitigkeit</title><path d="M5 20 L32 6 L59 20 L32 34 Z" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 30 L5 34 L32 48 L59 34 L52 30" stroke="#08264D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 44 L5 48 L32 62 L59 48 L52 44" stroke="#397D0D" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
After Width: | Height: | Size: 533 B |
@@ -0,0 +1 @@
|
||||
<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><title>Wichtig</title><path d="M32 10 L46 15 L52 28 L46 41 L32 46 L18 41 L12 28 L18 15 Z" fill="none" stroke="#08264D" stroke-linejoin="round" stroke-width="3.2" /><line stroke="#397D0D" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="18" y2="31" /><circle cx="32" cy="37" fill="#397D0D" r="1.9" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="19" x2="16" y1="10" y2="5" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="32" x2="32" y1="7" y2="2" /><line stroke="#FFCD00" stroke-linecap="round" stroke-width="3.2" x1="45" x2="48" y1="10" y2="5" /></svg>
|
||||
|
After Width: | Height: | Size: 695 B |
@@ -1,4 +1,5 @@
|
||||
{{-- Gemeinsamer Picker für Website-Bilder und Videos im CMS (ChoosesWebsiteImages). --}}
|
||||
@include('filament.cms.link-picker')
|
||||
@if ($this->pickerOpen && in_array($this->pickerPurpose, ['website-bild', 'website-video'], true))
|
||||
@include('filament.verwaltung.picker')
|
||||
@endif
|
||||
@@ -0,0 +1,104 @@
|
||||
{{-- Dialog „Interne Seite oder Sprungmarke wählen“ (ChoosesLinkTargets): Schritt 1 Seite, Schritt 2 Sprungmarke. Wählen ändert und veröffentlicht nichts. --}}
|
||||
@if (property_exists($this, 'linkZiel') && $this->linkZiel !== null)
|
||||
@php
|
||||
$gewaehlt = $this->linkChosen();
|
||||
$seiten = $gewaehlt === null ? $this->linkPages() : [];
|
||||
$eigene = $this->linkOwnPage();
|
||||
$eigeneMarken = $this->linkOwnAnchors();
|
||||
@endphp
|
||||
<div class="vw vw-dialog luf-link-dialog" role="dialog" aria-modal="true" aria-labelledby="link-titel" wire:key="link-picker"
|
||||
x-data x-trap.noscroll="true"
|
||||
x-on:keydown.escape.stop="$wire.closeLinkPicker()"
|
||||
wire:click.self="closeLinkPicker">
|
||||
<div class="vw-dialog-karte is-schmal">
|
||||
<div class="vw-dialog-kopf">
|
||||
<div>
|
||||
<h2 id="link-titel">{{ $gewaehlt === null ? 'Interne Seite wählen' : 'Sprungmarke wählen' }}</h2>
|
||||
<p>
|
||||
@if ($gewaehlt === null)
|
||||
Der Link zeigt auf eine Seite dieser Website. Die Auswahl verändert und veröffentlicht keine Seite.
|
||||
@else
|
||||
Ziel: <strong>{{ $gewaehlt['titel'] }}</strong>@if ($gewaehlt['pfad'] !== null) <span class="luf-link-pfad">{{ $gewaehlt['pfad'] }}</span>@endif
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" class="vw-btn is-icon" wire:click="closeLinkPicker" aria-label="Schließen, ohne zu übernehmen">@include('filament.verwaltung.icon', ['name' => 'x'])</button>
|
||||
</div>
|
||||
|
||||
<div class="vw-dialog-inhalt vw-zielwahl">
|
||||
@if ($gewaehlt === null)
|
||||
<label class="vw-feldlabel" for="link-suche">Seite suchen</label>
|
||||
<span class="vw-suchfeld">
|
||||
@include('filament.verwaltung.icon', ['name' => 'suche'])
|
||||
<input id="link-suche" class="vw-eingabe" type="search" wire:model.live.debounce.250ms="linkSuche" placeholder="Titel oder Adresse" autocomplete="off" autofocus>
|
||||
</span>
|
||||
<ul class="vw-ziel-liste">
|
||||
@if ($this->linkHasOwnPage() && trim($this->linkSuche) === '')
|
||||
<li wire:key="link-diese">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="chooseLinkPage('diese')" titel="Diese Seite" :meta="$eigene?->path ?? 'Die Seite, die gerade bearbeitet wird'" symbol="dokument">
|
||||
<span class="vw-zustaende"><span class="vw-zustand">{{ count($eigeneMarken) }} {{ count($eigeneMarken) === 1 ? 'Sprungmarke' : 'Sprungmarken' }}</span></span>
|
||||
</x-vw.eintrag>
|
||||
</li>
|
||||
@endif
|
||||
@foreach ($seiten as $seite)
|
||||
<li wire:key="link-{{ $seite['id'] }}">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="chooseLinkPage('{{ $seite['id'] }}')" :titel="$seite['titel']" :meta="$seite['pfad']" symbol="dokument">
|
||||
<span class="vw-zustaende">
|
||||
<span @class(['vw-zustand', 'is-'.$seite['zustand']['ton']])>{{ $seite['zustand']['label'] }}</span>
|
||||
@if ($seite['marken'] > 0)<span class="vw-zustand">{{ $seite['marken'] }} {{ $seite['marken'] === 1 ? 'Sprungmarke' : 'Sprungmarken' }}</span>@endif
|
||||
</span>
|
||||
</x-vw.eintrag>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@if ($seiten === [] && trim($this->linkSuche) !== '')
|
||||
<p class="vw-leer">Keine Seite gefunden. Prüfe die Schreibweise.</p>
|
||||
@endif
|
||||
@else
|
||||
<ul class="vw-ziel-liste">
|
||||
@unless ($gewaehlt['diese'])
|
||||
<li wire:key="link-anfang">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="applyLink" titel="Seitenanfang" :meta="$gewaehlt['pfad']" symbol="dokument">
|
||||
<span class="vw-zustaende"><span class="vw-zustand">Ohne Sprungmarke</span></span>
|
||||
</x-vw.eintrag>
|
||||
</li>
|
||||
@endunless
|
||||
@forelse ($gewaehlt['marken'] as $marke)
|
||||
<li wire:key="marke-{{ $marke['anchor'] }}">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="applyLink('{{ $marke['anchor'] }}')" :titel="$marke['label']" :meta="'#'.$marke['anchor']" symbol="dokument">
|
||||
<span class="vw-zustaende">
|
||||
@if ($marke['hidden'])<span class="vw-zustand is-achtung">Abschnitt ausgeblendet, Link führt ins Leere</span>@endif
|
||||
@if (! $gewaehlt['diese'] && ! $marke['published'] && ! $marke['hidden'])<span class="vw-zustand is-offen">Noch nicht veröffentlicht</span>@endif
|
||||
</span>
|
||||
</x-vw.eintrag>
|
||||
</li>
|
||||
@empty
|
||||
<li class="vw-leer">
|
||||
{{ $gewaehlt['diese'] ? 'Diese Seite hat noch keine Sprungmarke. Eine Sprungmarke legst du am Abschnitt fest („Name, Sprungmarke und Sichtbarkeit“).' : 'Diese Seite hat keine Sprungmarken. Der Link führt zum Seitenanfang.' }}
|
||||
</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
@if ($gewaehlt['diese'])
|
||||
<p class="vw-feld-hilfe">Der Link gilt nur auf dieser Seite („#marke“). Für Verweise von anderen Seiten wählst du die Seite selbst.</p>
|
||||
@elseif ($gewaehlt['adresse'] !== null)
|
||||
<p class="vw-feld-hilfe">Öffentliche Adresse der Seite: <span class="luf-link-pfad">{{ $gewaehlt['adresse'] }}</span>. Von außen führt „Adresse#marke“ zum Abschnitt.</p>
|
||||
@else
|
||||
<p class="vw-feld-hilfe">Die Seite ist noch nicht veröffentlicht; der Link funktioniert erst nach ihrer Veröffentlichung.</p>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="vw-dialog-fuss">
|
||||
<div class="vw-dialog-fuss-zeile">
|
||||
<span class="vw-feld-hilfe">{{ $gewaehlt === null ? 'Ein Klick wählt die Seite.' : 'Ein Klick übernimmt die Adresse in das Linkfeld.' }}</span>
|
||||
<div class="vw-knoepfe">
|
||||
@if ($gewaehlt !== null)
|
||||
<button type="button" class="vw-btn" wire:click="backToLinkPages">Andere Seite</button>
|
||||
@endif
|
||||
<button type="button" class="vw-btn" wire:click="closeLinkPicker">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -35,6 +35,14 @@
|
||||
.luf-abschnitt { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .65rem; }
|
||||
.luf-abschnitt-nr { font-weight: 700; }
|
||||
.luf-abschnitt-meta { font-size: .8rem; font-weight: 500; color: #3e4c5c; }
|
||||
.luf-abschnitt-nummer { font-size: .8rem; font-weight: 500; color: #3e4c5c; }
|
||||
.luf-abschnitt-marke { font-size: .78rem; font-weight: 600; color: #032551; background: #e6edf7; border-radius: .35rem; padding: .05rem .4rem; }
|
||||
.luf-abschnitt-aus { font-size: .78rem; font-weight: 700; color: #5a3b00; background: #fdeec4; border: 1px solid #c98a00; border-radius: .35rem; padding: .05rem .4rem; }
|
||||
/* Ausgeblendeter Abschnitt: gestrichelte Kante und zurückgenommener Inhalt, der Kopf bleibt gut lesbar. */
|
||||
.luf-sections > .fi-fo-repeater-items > .fi-fo-repeater-item:has(.luf-abschnitt.is-ausgeblendet) { border-left-style: dashed; border-left-color: #c98a00; }
|
||||
.luf-sections > .fi-fo-repeater-items > .fi-fo-repeater-item:has(.luf-abschnitt.is-ausgeblendet) > .fi-fo-repeater-item-content { opacity: .72; }
|
||||
.luf-abschnitt-bezeichnung { margin-bottom: .5rem; }
|
||||
.luf-link-pfad { font-family: ui-monospace, monospace; font-size: .85em; overflow-wrap: anywhere; }
|
||||
|
||||
/* Rasterauswahl als grafische Kacheln */
|
||||
.luf-layout-picker .fi-btn-group { flex-wrap: wrap; gap: .5rem; }
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
$e = $this->eintraege[$this->zielwahl];
|
||||
$seiten = $this->zielSeiten();
|
||||
$aktuell = $e['page_id'] !== null ? (int) $e['page_id'] : null;
|
||||
$zweiter = $this->zielSeite !== null;
|
||||
$marken = $zweiter ? $this->zielMarken($this->zielSeite) : [];
|
||||
$aktuelleMarke = trim($e['anchor'] ?? '');
|
||||
@endphp
|
||||
<div class="vw vw-dialog" role="dialog" aria-modal="true" aria-labelledby="ziel-titel" wire:key="zielwahl-{{ $this->zielwahl }}"
|
||||
x-data x-trap.noscroll="true"
|
||||
@@ -11,12 +14,30 @@
|
||||
<div class="vw-dialog-karte is-schmal">
|
||||
<div class="vw-dialog-kopf">
|
||||
<div>
|
||||
<h2 id="ziel-titel">Zielseite wählen</h2>
|
||||
<h2 id="ziel-titel">{{ $zweiter ? 'Sprungmarke wählen' : 'Zielseite wählen' }}</h2>
|
||||
<p>Für den Menüeintrag <strong>{{ trim($e['label']) ?: 'Ohne Menütext' }}</strong>. Die Auswahl veröffentlicht keine Seite.</p>
|
||||
</div>
|
||||
<button type="button" class="vw-btn is-icon" wire:click="schliesseZielwahl" aria-label="Schließen, ohne zu übernehmen">@include('filament.verwaltung.icon', ['name' => 'x'])</button>
|
||||
</div>
|
||||
<div class="vw-dialog-inhalt vw-zielwahl">
|
||||
@if ($zweiter)
|
||||
<ul class="vw-ziel-liste">
|
||||
<li wire:key="marke-anfang">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="waehleMarke" titel="Seitenanfang" meta="Ohne Sprungmarke" symbol="dokument" @class(['is-aktuell' => $aktuelleMarke === '']) aria-current="{{ $aktuelleMarke === '' ? 'true' : 'false' }}"></x-vw.eintrag>
|
||||
</li>
|
||||
@foreach ($marken as $marke)
|
||||
<li wire:key="marke-{{ $marke['anchor'] }}">
|
||||
<x-vw.eintrag as="button" type="button" wire:click="waehleMarke('{{ $marke['anchor'] }}')" :titel="$marke['label']" :meta="'#'.$marke['anchor']" symbol="dokument" @class(['is-aktuell' => $aktuelleMarke === $marke['anchor']]) aria-current="{{ $aktuelleMarke === $marke['anchor'] ? 'true' : 'false' }}">
|
||||
<span class="vw-zustaende">
|
||||
@if ($marke['hidden'])<span class="vw-zustand is-achtung">Abschnitt ausgeblendet, Link führt ins Leere</span>@endif
|
||||
@if (! $marke['published'] && ! $marke['hidden'])<span class="vw-zustand is-offen">Noch nicht veröffentlicht</span>@endif
|
||||
</span>
|
||||
</x-vw.eintrag>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<p class="vw-feld-hilfe">Der Menüeintrag führt dann zu diesem Abschnitt der Seite. „Seitenanfang“ lässt die Marke weg.</p>
|
||||
@else
|
||||
<label class="vw-feldlabel" for="ziel-suche">Seite suchen</label>
|
||||
<span class="vw-suchfeld">
|
||||
@include('filament.verwaltung.icon', ['name' => 'suche'])
|
||||
@@ -36,10 +57,11 @@
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
<div class="vw-dialog-fuss">
|
||||
<div class="vw-dialog-fuss-zeile">
|
||||
<span class="vw-feld-hilfe">Ein Klick übernimmt die Seite als Ziel in den Arbeitsstand.</span>
|
||||
<span class="vw-feld-hilfe">{{ $zweiter ? 'Ein Klick übernimmt die Sprungmarke in den Arbeitsstand.' : 'Ein Klick übernimmt die Seite als Ziel in den Arbeitsstand.' }}</span>
|
||||
<div class="vw-knoepfe">
|
||||
<button type="button" class="vw-btn" wire:click="schliesseZielwahl">Abbrechen</button>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,9 @@ dieselbe Regel, die hier an einer Stelle steht:
|
||||
- Nur *.svg. Dateien wie *.old und Fassungen mit „_alternative“ im Namen werden übersprungen.
|
||||
- „_v03“ (oder eine andere „_vNN“-Fassung) wird aus dem Schlüssel entfernt und hat Vorrang vor der Datei ohne Zusatz.
|
||||
- Unterstriche werden zu Bindestrichen (der Loader erlaubt nur a–z, 0–9 und Bindestrich).
|
||||
- Dateien aus Zeichenprogrammen werden beim Übernehmen bereinigt (siehe normalize): XML-Vorspann, baseProfile, version,
|
||||
unbenutzte Namensräume und leere defs entfallen, ein fehlender title wird aus dem Schlüssel ergänzt. Der Loader
|
||||
(App/Support/Brand/Symbols.php) erwartet, dass die Datei mit dem svg-Tag beginnt.
|
||||
- Ein Schlüssel, den es schon gibt, wird nie überschrieben. Der Fall wird gemeldet (Kollision), damit entschieden wird,
|
||||
ob die Datei dasselbe Motiv ist (dann bleibt der alte Satz) oder ein eigener Schlüssel nötig ist.
|
||||
|
||||
@@ -16,7 +19,6 @@ Danach: python scripts/brand-symbol-bounds.py und Einträge in resources/svg/bra
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parent.parent
|
||||
@@ -28,6 +30,21 @@ def key_of(stem: str) -> str:
|
||||
return stem.replace("_", "-").lower()
|
||||
|
||||
|
||||
def normalize(svg: str, key: str) -> str:
|
||||
svg = svg.strip().lstrip("")
|
||||
svg = re.sub(r"^<\?xml[^>]*\?>\s*", "", svg)
|
||||
svg = re.sub(r"<defs\s*/>", "", svg)
|
||||
root = re.match(r"<svg\b[^>]*>", svg)
|
||||
if root is None:
|
||||
raise ValueError(f"{key}: keine SVG-Wurzel")
|
||||
tag = root.group(0)
|
||||
new = re.sub(r'\s(?:baseProfile|version|xmlns:ev|xmlns:xlink)="[^"]*"', "", tag)
|
||||
svg = new + svg[len(tag):]
|
||||
if "<title" not in svg:
|
||||
svg = new + f"<title>{key.replace('-', ' ').capitalize()}</title>" + svg[len(new):]
|
||||
return svg + "\n"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = [a for a in sys.argv[1:] if not a.startswith("--")]
|
||||
dry = "--dry-run" in sys.argv
|
||||
@@ -64,7 +81,7 @@ def main() -> int:
|
||||
collisions.append(f"{key}: {'identisch' if same else 'ANDERES Motiv'} (vorhanden, nicht überschrieben)")
|
||||
continue
|
||||
if not dry:
|
||||
shutil.copyfile(file, TARGET / f"{key}.svg")
|
||||
(TARGET / f"{key}.svg").write_text(normalize(file.read_text(encoding="utf-8"), key), encoding="utf-8", newline="\n")
|
||||
added.append(key)
|
||||
|
||||
catalog_file = TARGET / "_katalog.json"
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Catalog\FormattedText;
|
||||
use App\Domain\Cms\LinkTargets;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Domain\Cms\Widgets\Support\RichText;
|
||||
use App\Domain\Cms\Widgets\Types\ImageTextWidget;
|
||||
use App\Filament\Resources\Pages\Pages\EditPage;
|
||||
use App\Filament\Support\RichField;
|
||||
use App\Models\User;
|
||||
use Filament\Facades\Filament;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Features\SupportTesting\Testable;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Auswahl interner Linkziele (Seiten und Sprungmarken) und die Felder für Name, Sprungmarke und Ausblenden im Editor.
|
||||
*/
|
||||
class CmsLinkPickerTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
Filament::setCurrentPanel(Filament::getPanel('verwaltung'));
|
||||
}
|
||||
|
||||
private function editor(): User
|
||||
{
|
||||
$editor = User::factory()->redakteur()->create();
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
return $editor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $extra
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function section(string $heading, array $extra = []): array
|
||||
{
|
||||
return $extra + ['layout' => 'u4', 'style' => [], 'slots' => [['type' => 'heading', 'v' => 1, 'data' => ['heading' => $heading]]]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string, mixed>> $sections
|
||||
*/
|
||||
private function page(string $path, array $sections, bool $publish = false): Page
|
||||
{
|
||||
$service = app(PageService::class);
|
||||
$page = Page::query()->create(['path' => $path]);
|
||||
$revision = $service->saveRevision($page, $sections, null, null, null);
|
||||
|
||||
if ($publish) {
|
||||
$service->publish($page, $revision);
|
||||
}
|
||||
|
||||
return $page->fresh();
|
||||
}
|
||||
|
||||
private function editorFor(Page $page): Testable
|
||||
{
|
||||
return Livewire::actingAs($this->editor(), 'staff')->test(EditPage::class, ['record' => $page->id]);
|
||||
}
|
||||
|
||||
public function test_the_editor_saves_name_anchor_and_hidden_and_reports_a_duplicate_anchor_at_the_field(): void
|
||||
{
|
||||
$page = $this->page('/sprung', [$this->section('A'), $this->section('B')]);
|
||||
$component = $this->editorFor($page);
|
||||
$keys = array_keys($component->get('data.sections'));
|
||||
|
||||
$component
|
||||
->set("data.sections.{$keys[0]}.name", 'Kursübersicht')
|
||||
->set("data.sections.{$keys[0]}.anchor", 'kurse')
|
||||
->set("data.sections.{$keys[1]}.hidden", true)
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
|
||||
$sections = $page->fresh()->latestRevision->sections();
|
||||
$this->assertSame(['Kursübersicht', 'kurse', false], [$sections[0]['name'], $sections[0]['anchor'], $sections[0]['hidden']]);
|
||||
$this->assertTrue($sections[1]['hidden']);
|
||||
|
||||
$component = $this->editorFor($page->fresh());
|
||||
$keys = array_keys($component->get('data.sections'));
|
||||
$component
|
||||
->set("data.sections.{$keys[1]}.anchor", 'kurse')
|
||||
->call('save')
|
||||
->assertHasFormErrors(["sections.{$keys[1]}.anchor"]);
|
||||
}
|
||||
|
||||
public function test_a_change_of_the_section_name_counts_as_unsaved(): void
|
||||
{
|
||||
$page = $this->page('/stand', [$this->section('A')]);
|
||||
$component = $this->editorFor($page);
|
||||
$key = array_key_first($component->get('data.sections'));
|
||||
|
||||
$this->assertFalse($component->instance()->hasUnsavedEditorChanges());
|
||||
|
||||
$component->set("data.sections.{$key}.name", 'Neu');
|
||||
$this->assertTrue($component->instance()->hasUnsavedEditorChanges());
|
||||
}
|
||||
|
||||
public function test_the_picker_writes_a_page_with_and_without_anchor_into_the_chosen_field(): void
|
||||
{
|
||||
$other = $this->page('/kurse', [$this->section('Kurse', ['name' => 'Anmeldung', 'anchor' => 'anmeldung'])], publish: true);
|
||||
$own = $this->page('/start', [$this->section('Start')]);
|
||||
|
||||
$component = $this->editorFor($own);
|
||||
|
||||
$component->call('openLinkPicker', 'data.seo_title')->assertSet('linkZiel', 'data.seo_title');
|
||||
$component->call('chooseLinkPage', (string) $other->id)->call('applyLink', 'anmeldung')
|
||||
->assertSet('data.seo_title', '/kurse#anmeldung')
|
||||
->assertSet('linkZiel', null);
|
||||
|
||||
$component->call('openLinkPicker', 'data.seo_title')->call('chooseLinkPage', (string) $other->id)->call('applyLink')
|
||||
->assertSet('data.seo_title', '/kurse');
|
||||
}
|
||||
|
||||
public function test_the_picker_offers_anchors_of_the_page_in_the_editor_including_unsaved_ones(): void
|
||||
{
|
||||
$own = $this->page('/eigene', [$this->section('A'), $this->section('B')]);
|
||||
$component = $this->editorFor($own);
|
||||
$keys = array_keys($component->get('data.sections'));
|
||||
|
||||
$component->set("data.sections.{$keys[1]}.anchor", 'noch-nicht-gespeichert');
|
||||
$component->call('openLinkPicker', 'data.seo_description')->call('chooseLinkPage', 'diese');
|
||||
|
||||
$this->assertSame(['noch-nicht-gespeichert'], array_column($component->instance()->linkChosen()['marken'], 'anchor'));
|
||||
|
||||
$component->call('applyLink', 'noch-nicht-gespeichert')->assertSet('data.seo_description', '#noch-nicht-gespeichert');
|
||||
}
|
||||
|
||||
public function test_the_picker_refuses_unknown_anchors_and_foreign_targets(): void
|
||||
{
|
||||
$other = $this->page('/ziel', [$this->section('A', ['anchor' => 'da'])]);
|
||||
$component = $this->editorFor($this->page('/quelle', [$this->section('Q')]));
|
||||
|
||||
$component->call('openLinkPicker', 'data.seo_title')->call('chooseLinkPage', (string) $other->id)
|
||||
->call('applyLink', 'gibt-es-nicht')
|
||||
->assertSet('data.seo_title', null)
|
||||
->assertSet('linkZiel', 'data.seo_title');
|
||||
|
||||
// Kein Formularpfad, in den die Auswahl schreiben darf: der Dialog öffnet sich nicht.
|
||||
$component->call('closeLinkPicker')->call('openLinkPicker', 'record.path')->assertSet('linkZiel', null);
|
||||
$component->call('openLinkPicker', 'data.path; evil')->assertSet('linkZiel', null);
|
||||
}
|
||||
|
||||
public function test_the_page_list_leaves_out_the_page_in_the_editor_and_filters_by_title_and_path(): void
|
||||
{
|
||||
$this->page('/kurse', [$this->section('Kursangebot')]);
|
||||
$own = $this->page('/hier', [$this->section('Hier')]);
|
||||
|
||||
$component = $this->editorFor($own);
|
||||
$paths = array_column($component->instance()->linkPages(), 'pfad');
|
||||
$this->assertContains('/kurse', $paths);
|
||||
$this->assertNotContains('/hier', $paths);
|
||||
|
||||
$component->set('linkSuche', 'angebot');
|
||||
$this->assertSame(['/kurse'], array_column($component->instance()->linkPages(), 'pfad'));
|
||||
}
|
||||
|
||||
public function test_anchors_of_other_pages_say_whether_they_are_published_or_hidden(): void
|
||||
{
|
||||
$service = app(PageService::class);
|
||||
$page = $this->page('/stand', [$this->section('A', ['anchor' => 'alt']), $this->section('B', ['anchor' => 'versteckt'])], publish: true);
|
||||
$service->saveRevision($page, [
|
||||
$this->section('A', ['anchor' => 'alt']),
|
||||
$this->section('B', ['anchor' => 'versteckt', 'hidden' => true]),
|
||||
$this->section('C', ['anchor' => 'neu', 'name' => 'Neuer Abschnitt']),
|
||||
], null, null, null);
|
||||
|
||||
$anchors = collect(app(LinkTargets::class)->anchorsForPage($page->fresh()))->keyBy('anchor');
|
||||
|
||||
$this->assertTrue($anchors['alt']['published']);
|
||||
$this->assertFalse($anchors['alt']['hidden']);
|
||||
$this->assertTrue($anchors['versteckt']['hidden']);
|
||||
$this->assertFalse($anchors['neu']['published']);
|
||||
$this->assertSame('Neuer Abschnitt', $anchors['neu']['label']);
|
||||
}
|
||||
|
||||
public function test_the_href_forms_pass_the_link_check(): void
|
||||
{
|
||||
$targets = app(LinkTargets::class);
|
||||
|
||||
$this->assertSame('#kurse', $targets->href(null, 'kurse'));
|
||||
$this->assertSame('/seite#kurse', $targets->href('/seite', 'kurse'));
|
||||
$this->assertSame('/seite', $targets->href('/seite', null));
|
||||
$this->assertSame('/seite', $targets->href('/seite', 'Ungültig!'));
|
||||
$this->assertNull($targets->href(null, null));
|
||||
}
|
||||
|
||||
public function test_widgets_link_to_a_section_of_the_same_page_and_to_another_page(): void
|
||||
{
|
||||
$this->page('/ziel', [$this->section('Ziel', ['anchor' => 'unten'])], publish: true);
|
||||
$cta = fn (string $url): array => ['type' => 'call_to_action', 'v' => 1, 'data' => ['heading' => 'Mehr', 'label' => 'Zum Kurs', 'url' => $url]];
|
||||
$this->page('/quelle', [
|
||||
$this->section('Q', ['anchor' => 'oben', 'slots' => [$cta('#unten')]]),
|
||||
$this->section('R', ['slots' => [$cta('/ziel#unten')]]),
|
||||
], publish: true);
|
||||
|
||||
$html = $this->get('/quelle')->assertOk()->getContent();
|
||||
|
||||
$this->assertStringContainsString('href="#unten"', $html);
|
||||
$this->assertStringContainsString('/ziel#unten', $html);
|
||||
$this->assertStringContainsString('id="oben"', $html);
|
||||
$this->get('/ziel')->assertOk()->assertSee('id="unten"', false);
|
||||
}
|
||||
|
||||
public function test_links_to_anchors_survive_the_text_sanitizers(): void
|
||||
{
|
||||
$html = '<p><a href="#kurse">hier</a> und <a href="/ziel#unten">dort</a></p>';
|
||||
|
||||
foreach ([RichText::sanitize($html), FormattedText::canonical($html, site: true)] as $clean) {
|
||||
$this->assertStringContainsString('href="#kurse"', $clean);
|
||||
$this->assertStringContainsString('href="/ziel#unten"', $clean);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_website_text_editors_offer_the_internal_link_tool(): void
|
||||
{
|
||||
foreach ([RichField::make('body', 'Text', website: true), (new ImageTextWidget)->dataFields()[2]] as $editor) {
|
||||
$buttons = (new \ReflectionProperty($editor, 'toolbarButtons'))->getValue($editor);
|
||||
$this->assertContains('interneSeite', array_merge(...$buttons), 'Das Werkzeug fehlt in der Symbolleiste.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Domain\Cms\Sections\PageSections;
|
||||
use App\Domain\Cms\Sections\SectionRenderer;
|
||||
use App\Domain\Cms\Widgets\RenderContext;
|
||||
use App\Domain\Cms\Widgets\Support\SafeUrl;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Name, Sprungmarke und Ausblenden eines Abschnitts: Speichern, Lesen, öffentliche Darstellung und Vorschau.
|
||||
*/
|
||||
class CmsSectionLabelsTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $extra
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function section(string $heading, array $extra = []): array
|
||||
{
|
||||
return $extra + [
|
||||
'layout' => 'u4',
|
||||
'style' => [],
|
||||
'slots' => [['type' => 'heading', 'v' => 1, 'data' => ['heading' => $heading]]],
|
||||
];
|
||||
}
|
||||
|
||||
private function sections(): PageSections
|
||||
{
|
||||
return app(PageSections::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string, mixed>> $sections
|
||||
*/
|
||||
private function html(array $sections, bool $preview = false): string
|
||||
{
|
||||
$read = $this->sections()->read($this->sections()->normalize($sections));
|
||||
|
||||
return app(SectionRenderer::class)->renderAll($read, $preview ? RenderContext::preview() : RenderContext::publicPage())->toHtml();
|
||||
}
|
||||
|
||||
public function test_name_anchor_and_hidden_are_saved_and_read_back(): void
|
||||
{
|
||||
$saved = $this->sections()->normalize([
|
||||
$this->section('Kurse', ['name' => ' Kurs Übersicht ', 'anchor' => ' Kurse-2026 ', 'hidden' => true]),
|
||||
$this->section('Kontakt'),
|
||||
]);
|
||||
|
||||
$this->assertSame('Kurs Übersicht', $saved[0]['name']);
|
||||
$this->assertSame('kurse-2026', $saved[0]['anchor']);
|
||||
$this->assertTrue($saved[0]['hidden']);
|
||||
$this->assertNull($saved[1]['name']);
|
||||
$this->assertNull($saved[1]['anchor']);
|
||||
$this->assertFalse($saved[1]['hidden']);
|
||||
|
||||
$read = $this->sections()->read($saved);
|
||||
$this->assertSame(['Kurs Übersicht', 'kurse-2026', true], [$read[0]['name'], $read[0]['anchor'], $read[0]['hidden']]);
|
||||
}
|
||||
|
||||
public function test_sections_saved_before_these_fields_read_with_defaults(): void
|
||||
{
|
||||
$read = $this->sections()->read([['id' => 'a1', 'v' => 2, 'layout' => 'u4', 'style' => [], 'slots' => [null]]]);
|
||||
|
||||
$this->assertSame([null, null, false], [$read[0]['name'], $read[0]['anchor'], $read[0]['hidden']]);
|
||||
}
|
||||
|
||||
public function test_an_invalid_stored_anchor_is_not_trusted_when_reading(): void
|
||||
{
|
||||
$read = $this->sections()->read([['id' => 'a1', 'layout' => 'u4', 'anchor' => 'Evil"><script>', 'name' => str_repeat('x', 200), 'slots' => [null]]]);
|
||||
|
||||
$this->assertNull($read[0]['anchor']);
|
||||
$this->assertNull($read[0]['name']);
|
||||
}
|
||||
|
||||
public function test_anchors_must_be_valid_and_unique_per_page(): void
|
||||
{
|
||||
foreach (['Mit Leerzeichen', 'ümlaut', '-anfang', 'ende-', 'doppel--strich', str_repeat('a', 61)] as $invalid) {
|
||||
try {
|
||||
$this->sections()->normalize([$this->section('A', ['anchor' => $invalid])]);
|
||||
$this->fail("Sprungmarke „{$invalid}“ hätte abgewiesen werden müssen.");
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayHasKey('sections.0.anchor', $exception->errors(), $invalid);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$this->sections()->normalize([$this->section('A', ['anchor' => 'kurse']), $this->section('B', ['anchor' => 'KURSE'])]);
|
||||
$this->fail('Eine doppelte Sprungmarke muss abgewiesen werden.');
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayNotHasKey('sections.0.anchor', $exception->errors());
|
||||
$this->assertStringContainsString('schon', $exception->errors()['sections.1.anchor'][0]);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_reserved_identifiers_cannot_be_used_as_anchor(): void
|
||||
{
|
||||
foreach (['inhalt', 'site-nav', 'bereich-abc'] as $reserved) {
|
||||
try {
|
||||
$this->sections()->normalize([$this->section('A', ['anchor' => $reserved])]);
|
||||
$this->fail("„{$reserved}“ ist reserviert.");
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayHasKey('sections.0.anchor', $exception->errors(), $reserved);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function test_a_name_longer_than_the_limit_is_reported(): void
|
||||
{
|
||||
try {
|
||||
$this->sections()->normalize([$this->section('A', ['name' => str_repeat('n', 81)])]);
|
||||
$this->fail('Ein zu langer Name muss gemeldet werden.');
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayHasKey('sections.0.name', $exception->errors());
|
||||
}
|
||||
}
|
||||
|
||||
public function test_the_anchor_becomes_the_section_id_and_the_name_is_never_public(): void
|
||||
{
|
||||
$html = $this->html([
|
||||
$this->section('Kurse', ['name' => 'Geheimer interner Name', 'anchor' => 'kurse']),
|
||||
$this->section('Kontakt'),
|
||||
]);
|
||||
|
||||
$this->assertStringContainsString('id="kurse"', $html);
|
||||
$this->assertSame(1, substr_count($html, 'id="bereich-'), 'Ohne Sprungmarke bleibt die bisherige Kennung.');
|
||||
$this->assertStringNotContainsString('Geheimer interner Name', $html);
|
||||
}
|
||||
|
||||
public function test_a_hidden_section_never_appears_on_the_website(): void
|
||||
{
|
||||
$html = $this->html([
|
||||
$this->section('Sichtbar'),
|
||||
$this->section('Versteckter Inhalt', ['name' => 'Geheim', 'anchor' => 'weg', 'hidden' => true]),
|
||||
]);
|
||||
|
||||
$this->assertStringContainsString('Sichtbar', $html);
|
||||
$this->assertStringNotContainsString('Versteckter Inhalt', $html);
|
||||
$this->assertStringNotContainsString('id="weg"', $html);
|
||||
$this->assertStringNotContainsString('section-hidden-note', $html);
|
||||
}
|
||||
|
||||
public function test_the_preview_shows_only_a_note_for_a_hidden_section(): void
|
||||
{
|
||||
$html = $this->html([
|
||||
$this->section('Sichtbar'),
|
||||
$this->section('Versteckter Inhalt', ['name' => 'Kurse', 'hidden' => true]),
|
||||
], preview: true);
|
||||
|
||||
$this->assertStringNotContainsString('Versteckter Inhalt', $html);
|
||||
$this->assertStringContainsString('section-hidden-note', $html);
|
||||
$this->assertStringContainsString('„Kurse“', $html);
|
||||
}
|
||||
|
||||
public function test_a_hidden_first_section_does_not_take_the_page_heading(): void
|
||||
{
|
||||
$block = fn (string $text, bool $hidden): array => $this->section($text, ['hidden' => $hidden]);
|
||||
|
||||
foreach ([false, true] as $preview) {
|
||||
$html = $this->html([$block('Verborgener Einstieg', true), $block('Echter Einstieg', false)], $preview);
|
||||
|
||||
$this->assertMatchesRegularExpression('/<h1[^>]*>\s*Echter Einstieg/u', $html, $preview ? 'Vorschau' : 'öffentlich');
|
||||
$this->assertStringNotContainsString('Verborgener Einstieg', $html);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_a_hidden_section_does_not_leave_a_divider_before_the_last_visible_section(): void
|
||||
{
|
||||
$html = $this->html([
|
||||
$this->section('Erster', ['style' => ['divider' => 'line']]),
|
||||
$this->section('Verborgen', ['hidden' => true, 'style' => ['divider' => 'line']]),
|
||||
]);
|
||||
|
||||
$this->assertStringNotContainsString('section-divider', $html, 'Trenner stehen nie nach dem letzten sichtbaren Abschnitt.');
|
||||
}
|
||||
|
||||
public function test_hidden_sections_keep_their_media_but_not_the_page_title(): void
|
||||
{
|
||||
$hiddenOnly = $this->sections()->normalize([
|
||||
$this->section('Titel des verborgenen Abschnitts', ['hidden' => true]),
|
||||
$this->section('Titel des sichtbaren Abschnitts'),
|
||||
]);
|
||||
|
||||
$this->assertSame('Titel des sichtbaren Abschnitts', $this->sections()->pageTitle($hiddenOnly));
|
||||
}
|
||||
|
||||
public function test_the_fields_survive_a_saved_revision_and_a_duplicate_save(): void
|
||||
{
|
||||
$page = Page::query()->create(['path' => '/sprungmarken']);
|
||||
$service = app(PageService::class);
|
||||
$revision = $service->saveRevision($page, [$this->section('Kurse', ['name' => 'Kurse', 'anchor' => 'kurse', 'hidden' => true])], null, null, null);
|
||||
|
||||
$stored = $revision->sections();
|
||||
$this->assertSame(['Kurse', 'kurse', true], [$stored[0]['name'], $stored[0]['anchor'], $stored[0]['hidden']]);
|
||||
}
|
||||
|
||||
public function test_safe_url_accepts_anchors_on_the_page_and_on_other_pages(): void
|
||||
{
|
||||
foreach (['#kurse', '#abschnitt_2', '/praevention#anmeldung', 'https://example.org/seite#teil'] as $ok) {
|
||||
$this->assertTrue(SafeUrl::isSafe($ok), $ok);
|
||||
}
|
||||
|
||||
foreach (['#', '# kurse', '#a b', '#"><x', '##x', 'javascript:alert(1)', '#'.str_repeat('a', 81)] as $bad) {
|
||||
$this->assertFalse(SafeUrl::isSafe($bad), $bad);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Filament\Pages\Webpraesenz;
|
||||
use App\Models\User;
|
||||
use Filament\Facades\Filament;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Features\SupportTesting\Testable;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Menüeinträge mit Sprungmarke: zweiter Schritt der Zielwahl, Speichern, Wirkung in der Navigation der Website.
|
||||
*/
|
||||
class WebpraesenzAnchorTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Filament::setCurrentPanel(Filament::getPanel('verwaltung'));
|
||||
}
|
||||
|
||||
private function menus(): Testable
|
||||
{
|
||||
$editor = User::factory()->redakteur()->create();
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
return Livewire::withQueryParams(['bereich' => 'menues'])->actingAs($editor, 'staff')->test(Webpraesenz::class);
|
||||
}
|
||||
|
||||
private function pageWithAnchors(): Page
|
||||
{
|
||||
$service = app(PageService::class);
|
||||
$page = Page::query()->create(['path' => '/kurse']);
|
||||
$revision = $service->saveRevision($page, [
|
||||
['layout' => 'u4', 'style' => [], 'name' => 'Anmeldung', 'anchor' => 'anmeldung', 'slots' => [['type' => 'heading', 'v' => 1, 'data' => ['heading' => 'Kurse']]]],
|
||||
['layout' => 'u4', 'style' => [], 'anchor' => 'preise', 'hidden' => true, 'slots' => [['type' => 'heading', 'v' => 1, 'data' => ['heading' => 'Preise']]]],
|
||||
], null, null, null);
|
||||
$service->publish($page, $revision);
|
||||
|
||||
return $page->fresh();
|
||||
}
|
||||
|
||||
public function test_a_page_with_anchors_leads_to_a_second_step_and_the_anchor_is_saved(): void
|
||||
{
|
||||
$page = $this->pageWithAnchors();
|
||||
|
||||
$this->menus()
|
||||
->call('zeigeMenue', 'header')
|
||||
->call('eintragHinzufuegen')
|
||||
->set('eintraege.n1.label', 'Kurs anmelden')
|
||||
->call('oeffneZielwahl', 'n1')
|
||||
->call('waehleZiel', $page->id)
|
||||
->assertSet('zielSeite', $page->id)
|
||||
->assertSet('zielwahl', 'n1')
|
||||
->assertSee('Sprungmarke wählen')
|
||||
->assertSee('Anmeldung')
|
||||
->assertSee('Abschnitt ausgeblendet')
|
||||
->call('waehleMarke', 'anmeldung')
|
||||
->assertSet('zielwahl', null)
|
||||
->assertSet('zielSeite', null)
|
||||
->assertSet('eintraege.n1.anchor', 'anmeldung')
|
||||
->call('speichern')
|
||||
->assertHasNoErrors();
|
||||
|
||||
$item = NavigationItem::query()->where('label', 'Kurs anmelden')->firstOrFail();
|
||||
$this->assertSame($page->id, $item->page_id);
|
||||
$this->assertSame('anmeldung', $item->anchor);
|
||||
$this->assertSame(url('/kurse').'#anmeldung', $item->href());
|
||||
|
||||
$this->get('/')->assertOk()->assertSee('/kurse#anmeldung', false);
|
||||
}
|
||||
|
||||
public function test_the_page_start_leaves_the_anchor_empty_and_unknown_anchors_are_refused(): void
|
||||
{
|
||||
$page = $this->pageWithAnchors();
|
||||
|
||||
$component = $this->menus()
|
||||
->call('zeigeMenue', 'header')
|
||||
->call('eintragHinzufuegen')
|
||||
->set('eintraege.n1.label', 'Kurse')
|
||||
->call('oeffneZielwahl', 'n1')
|
||||
->call('waehleZiel', $page->id)
|
||||
->call('waehleMarke', 'gibt-es-nicht')
|
||||
->assertSet('zielwahl', 'n1')
|
||||
->assertSet('eintraege.n1.anchor', '')
|
||||
->call('waehleMarke')
|
||||
->assertSet('zielwahl', null)
|
||||
->call('speichern')
|
||||
->assertHasNoErrors();
|
||||
|
||||
$item = NavigationItem::query()->where('label', 'Kurse')->firstOrFail();
|
||||
$this->assertNull($item->anchor);
|
||||
$this->assertSame(url('/kurse'), $item->href());
|
||||
$component->assertSet('eintraege.e'.$item->id.'.anchor', '');
|
||||
}
|
||||
|
||||
public function test_a_new_target_page_or_a_free_address_drops_the_old_anchor(): void
|
||||
{
|
||||
$page = $this->pageWithAnchors();
|
||||
$impressum = Page::query()->where('path', '/impressum')->firstOrFail();
|
||||
|
||||
$this->menus()
|
||||
->call('zeigeMenue', 'header')
|
||||
->call('eintragHinzufuegen')
|
||||
->set('eintraege.n1.label', 'Wechsel')
|
||||
->call('oeffneZielwahl', 'n1')
|
||||
->call('waehleZiel', $page->id)
|
||||
->call('waehleMarke', 'anmeldung')
|
||||
->assertSet('eintraege.n1.anchor', 'anmeldung')
|
||||
->call('oeffneZielwahl', 'n1')
|
||||
->call('waehleZiel', $impressum->id)
|
||||
->assertSet('eintraege.n1.anchor', '')
|
||||
->assertSet('zielwahl', null)
|
||||
->call('oeffneZielwahl', 'n1')
|
||||
->call('waehleZiel', $page->id)
|
||||
->call('waehleMarke', 'anmeldung')
|
||||
->call('zielAdresseNutzen', 'n1')
|
||||
->assertSet('eintraege.n1.anchor', '')
|
||||
->assertSet('eintraege.n1.page_id', null);
|
||||
}
|
||||
|
||||
public function test_a_stale_anchor_in_the_working_state_is_refused_on_save(): void
|
||||
{
|
||||
$page = $this->pageWithAnchors();
|
||||
|
||||
$this->menus()
|
||||
->call('zeigeMenue', 'header')
|
||||
->call('eintragHinzufuegen')
|
||||
->set('eintraege.n1.label', 'Defekt')
|
||||
->set('eintraege.n1.page_id', $page->id)
|
||||
->set('eintraege.n1.anchor', 'Kaputt!')
|
||||
->call('speichern')
|
||||
->assertHasErrors(['eintraege.n1.anchor']);
|
||||
|
||||
$this->assertDatabaseMissing('navigation_items', ['label' => 'Defekt']);
|
||||
}
|
||||
|
||||
public function test_the_anchor_does_not_change_which_entry_counts_as_active(): void
|
||||
{
|
||||
$page = $this->pageWithAnchors();
|
||||
$item = NavigationItem::query()->create(['label' => 'Kurse', 'page_id' => $page->id, 'anchor' => 'anmeldung', 'placement' => 'header', 'sort_order' => 1]);
|
||||
|
||||
$this->assertSame('/kurse', $item->fresh()->targetPath());
|
||||
}
|
||||
}
|
||||
@@ -263,10 +263,41 @@ public function test_duplicated_section_is_inserted_right_after_its_original():
|
||||
$items = ['a' => ['n' => 1], 'b' => ['n' => 2], 'c' => ['n' => 3]];
|
||||
|
||||
$this->assertSame(['a', 'b', 'kopie', 'c'], array_keys(SectionEditor::insertCopyAfter($items, 'b', 'kopie')));
|
||||
$this->assertSame(['n' => 2], SectionEditor::insertCopyAfter($items, 'b', 'kopie')['kopie']);
|
||||
// Die Kopie hat nie eine Sprungmarke (sie wäre doppelt); ohne Namen bleibt sie ohne Namen.
|
||||
$this->assertSame(['n' => 2, 'anchor' => null, 'name' => null], SectionEditor::insertCopyAfter($items, 'b', 'kopie')['kopie']);
|
||||
$this->assertSame($items, SectionEditor::insertCopyAfter($items, 'fehlt', 'kopie'));
|
||||
}
|
||||
|
||||
public function test_a_duplicated_section_gives_up_its_anchor_so_the_page_still_saves(): void
|
||||
{
|
||||
$items = ['a' => [
|
||||
'name' => 'Kurse', 'anchor' => 'kurse', 'hidden' => true, 'layout' => 'u4', 'style' => [],
|
||||
'slots' => [['widget' => []]],
|
||||
]];
|
||||
|
||||
$copy = SectionEditor::insertCopyAfter($items, 'a', 'b');
|
||||
|
||||
$this->assertSame('kurse', $copy['a']['anchor']);
|
||||
$this->assertNull($copy['b']['anchor']);
|
||||
$this->assertSame('Kurse (Kopie)', $copy['b']['name']);
|
||||
$this->assertTrue($copy['b']['hidden']);
|
||||
|
||||
// Beide Abschnitte lassen sich gemeinsam speichern.
|
||||
$saved = $this->sections()->normalize(SectionEditor::fromEditorState($copy));
|
||||
$this->assertSame(['kurse', null], array_column($saved, 'anchor'));
|
||||
}
|
||||
|
||||
public function test_editor_state_round_trips_name_anchor_and_hidden(): void
|
||||
{
|
||||
$stored = $this->sections()->normalize([['name' => 'Kontakt', 'anchor' => 'kontakt', 'hidden' => true, 'layout' => 'u4', 'style' => [], 'slots' => [null]]]);
|
||||
|
||||
$state = SectionEditor::toEditorState($this->sections()->read($stored));
|
||||
$this->assertSame(['Kontakt', 'kontakt', true], [$state[0]['name'], $state[0]['anchor'], $state[0]['hidden']]);
|
||||
|
||||
$back = SectionEditor::fromEditorState($state);
|
||||
$this->assertSame(['Kontakt', 'kontakt', true], [$back[0]['name'], $back[0]['anchor'], $back[0]['hidden']]);
|
||||
}
|
||||
|
||||
public function test_layout_change_in_the_editor_never_drops_a_widget(): void
|
||||
{
|
||||
$slots = [
|
||||
|
||||
@@ -76,4 +76,28 @@ public function test_the_library_files_contain_nothing_active(): void
|
||||
$this->assertDoesNotMatchRegularExpression('/<script|<foreignObject|<image|<text\b|href=|javascript:|\son\w+=/i', $svg, $name);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_every_file_starts_with_the_svg_tag_and_has_a_view_box(): void
|
||||
{
|
||||
// Symbols::clean() erwartet das svg-Tag am Anfang; ein XML-Vorspann aus einem Zeichenprogramm würde inline in der
|
||||
// Seite stehen. scripts/brand-symbol-import.py entfernt ihn beim Übernehmen.
|
||||
foreach (Symbols::names() as $name) {
|
||||
$svg = trim((string) file_get_contents(resource_path("svg/brand/symbole/$name.svg")));
|
||||
|
||||
$this->assertStringStartsWith('<svg', $svg, $name);
|
||||
$this->assertMatchesRegularExpression('/^<svg\b[^>]*\sviewBox="0 0 \d+ \d+"/', $svg, $name);
|
||||
$this->assertStringNotContainsString('<?xml', $svg, $name);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_the_target_group_symbols_are_offered_in_their_own_group(): void
|
||||
{
|
||||
$group = collect(SymbolCatalog::groups())->firstWhere('name', 'Zielgruppen und Einrichtungen');
|
||||
|
||||
$this->assertNotNull($group);
|
||||
$this->assertSame(
|
||||
['eltern', 'gruppen', 'kita-kindergarten', 'oeffentliche-einrichtungen', 'schulen', 'verein'],
|
||||
collect($group['items'])->pluck('key')->sort()->values()->all(),
|
||||
);
|
||||
}
|
||||
}
|
||||