Füge Markensymbole und Material-Tags des Brand-Kits hinzu
CI Feature / test (push) Successful in 3m52s

Stufe 1 und 2 des Vorschlags in KIT_ERGAENZUNG_v2.1_kleingrafiken.md.
- 16 Symbole inline (x-brand.symbol): Titel, ID und feste Größe werden beim
  Einbetten entfernt, aria-hidden, unbekannte Namen sind ein Fehler
- Material-Tags als HTML/CSS (x-brand.tag) mit Zeichen und echtem Text,
  neue Tokens --lf-tag-*, Kontraste gemessen
- MaterialTag ordnet nach Ausgabeklasse und Kennung der redaktionellen Art
  zu, nicht nach Beschriftung; unklare Fälle bleiben Text
- Eingebaut in die öffentliche Premium-Karte für Medien
- brand-rays/-underline und der Mitgliederbereich bleiben unverändert
  (siehe Dokument, Abschnitt 1a)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-23 11:52:21 +01:00
1 parent 1d1f0ebb1f
commit 0022fd50cb
39 files changed
+489 -2

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
<?php
namespace App\Domain\Catalog;
/**
* Material-Tags des Brand-Kits (Film, Übung, PDF, Paket, Film + Übungen, Film + Merkblatt).
*
* Die Zuordnung hängt an Schlüsseln (Ausgabeklasse des Mediums, Kennung der redaktionellen Art), nie an Beschriftungen.
* Was nicht eindeutig zuzuordnen ist, bekommt kein Tag und bleibt Text:
* - „Paket“ und die beiden Kombinationen werden nicht automatisch vergeben (offen: Paket als Angebot oder als Programm;
* Kombinationen aus dem Modulaufbau berechnen oder redaktionell wählen). Die Komponente kann sie darstellen.
* - „Dokument“ ist nicht automatisch PDF; das Tag PDF gibt es nur für die Ausgabeklasse „pdf“.
*/
enum MaterialTag: string
{
case Film = 'film';
case Uebung = 'uebung';
case Pdf = 'pdf';
case Paket = 'paket';
case FilmUebungen = 'film-uebungen';
case FilmMerkblatt = 'film-merkblatt';
private const FILM_KINDS = ['unterrichtsfilm', 'kurzfilm', 'trailer', 'interview'];
private const EXERCISE_KINDS = ['arbeitsblatt', 'uebungsbeschreibung'];
public function label(): string
{
return match ($this) {
self::Film => 'Film',
self::Uebung => 'Übung',
self::Pdf => 'PDF',
self::Paket => 'Paket',
self::FilmUebungen => 'Film + Übungen',
self::FilmMerkblatt => 'Film + Merkblatt',
};
}
/** Name des Zeichens im Satz „glyphen“ (resources/svg/brand/glyphen). */
public function glyph(): string
{
return match ($this) {
self::Film => 'film',
self::Uebung => 'uebung',
self::Pdf, self::FilmMerkblatt => 'dokument',
self::Paket => 'paket',
self::FilmUebungen => 'filmstreifen',
};
}
public static function fromContent(?string $outputClass, ?string $editorialKindSlug = null): ?self
{
return match (true) {
$outputClass === 'film' => self::Film,
$outputClass === 'pdf' => self::Pdf,
in_array($editorialKindSlug, self::FILM_KINDS, true) => self::Film,
in_array($editorialKindSlug, self::EXERCISE_KINDS, true) => self::Uebung,
default => null,
};
}
}
+3
View File
@@ -15,6 +15,8 @@
* Redaktionsvorschau (Route editorial.card, nur für angemeldete Redaktion); öffentlich nie ausgegeben, weil es * Redaktionsvorschau (Route editorial.card, nur für angemeldete Redaktion); öffentlich nie ausgegeben, weil es
* keine Freigabe für die Website hat. * keine Freigabe für die Website hat.
* - missing: was für eine vollständige Karte fehlt, als Hinweis nur in der Redaktionsvorschau. * - missing: was für eine vollständige Karte fehlt, als Hinweis nur in der Redaktionsvorschau.
* - tag: Schlüssel eines Material-Tags (App\Domain\Catalog\MaterialTag), nur wenn die Art eindeutig zuzuordnen ist;
* sonst null, und die Karte zeigt die Art als Text wie bisher.
* - texts: die zentralen Texte des Fachobjekts, aus denen die Karte einen wählen kann (teaser, summary, description). * - texts: die zentralen Texte des Fachobjekts, aus denen die Karte einen wählen kann (teaser, summary, description).
* summary bleibt der Text der Vorgabe („Automatisch“); texts wird nur gelesen, wenn die Redaktion einen wählt. * summary bleibt der Text der Vorgabe („Automatisch“); texts wird nur gelesen, wenn die Redaktion einen wählt.
*/ */
@@ -39,6 +41,7 @@ public function __construct(
public array $missing = [], public array $missing = [],
public ?string $style = null, public ?string $style = null,
public array $texts = [], public array $texts = [],
public ?string $tag = null,
) {} ) {}
public function withText(?string $title, ?string $summary): self public function withText(?string $title, ?string $summary): self
@@ -6,6 +6,7 @@
use App\Domain\Catalog\ContentElement; use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentVersionStatus; use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\EditorialProfileReader; use App\Domain\Catalog\EditorialProfileReader;
use App\Domain\Catalog\MaterialTag;
use App\Domain\Catalog\StructureNode; use App\Domain\Catalog\StructureNode;
use App\Domain\Media\ThumbnailRef; use App\Domain\Media\ThumbnailRef;
use App\Domain\Media\WebsiteMedia; use App\Domain\Media\WebsiteMedia;
@@ -235,6 +236,7 @@ public function subject(mixed $id, bool $includeNonPublic, array $draft = []): ?
missing: $missing, missing: $missing,
style: $film ? 'media' : 'material', style: $film ? 'media' : 'material',
texts: $texts, texts: $texts,
tag: MaterialTag::fromContent((string) $shown->output_class, $element->editorialContentKind?->slug)?->value,
); );
} }
+84
View File
@@ -0,0 +1,84 @@
<?php
namespace App\Support\Brand;
use Illuminate\Support\HtmlString;
use InvalidArgumentException;
/**
* Kleingrafiken des Brand-Kits (docs/Brand-UI-Kit/16_Lara-Felix-Kleingrafiken) als Inline-SVG.
*
* - Nur Dateien aus resources/svg/brand/<Satz>/ sind zulässig; ein unbekannter Name ist ein Fehler, kein stiller Leerplatz.
* - Die Kit-Dateien tragen alle dieselbe ID (motif-title) und einen Titel. Beim Einbetten werden ID, Titel, Rolle und feste
* Größe entfernt, damit mehrere Symbole auf einer Seite keine doppelten IDs erzeugen. Symbole sind Beiwerk
* (aria-hidden); die Aussage trägt immer der danebenstehende Text.
* - Sätze: „symbole“ (Symbole und Akzente aus dem Kit, feste Markenfarben) und „glyphen“ (kleine Zeichen für Tags, Farbe
* über currentColor, Geometrie aus den Tag-Dateien des Kits).
* - Nicht enthalten: die Motive mit Text als Pfad (Pinsel, Pillen, Tags, Kompositionen). Text bleibt HTML.
*/
final class Symbols
{
public const SET_SYMBOLS = 'symbole';
public const SET_GLYPHS = 'glyphen';
/** @var array<string, string> */
private static array $cache = [];
/**
* @return list<string>
*/
public static function names(string $set = self::SET_SYMBOLS): array
{
$files = glob(self::directory($set).'/*.svg') ?: [];
$names = array_map(fn (string $file): string => basename($file, '.svg'), $files);
sort($names);
return $names;
}
public static function symbol(string $name, string $attributes = ''): HtmlString
{
return self::render(self::SET_SYMBOLS, $name, $attributes);
}
public static function glyph(string $name, string $attributes = ''): HtmlString
{
return self::render(self::SET_GLYPHS, $name, $attributes);
}
/**
* @param string $attributes bereits maskierte Attribute (aus der Attributtasche der Komponente)
*/
private static function render(string $set, string $name, string $attributes): HtmlString
{
if (! preg_match('/^[a-z0-9-]+$/', $name) || ! in_array($name, self::names($set), true)) {
throw new InvalidArgumentException("Unbekanntes Markensymbol „{$name}“ im Satz „{$set}“.");
}
$svg = self::$cache["$set/$name"] ??= self::clean((string) file_get_contents(self::directory($set)."/$name.svg"));
$extra = trim($attributes) === '' ? '' : ' '.trim($attributes);
return new HtmlString(preg_replace('/^<svg\b/', '<svg aria-hidden="true" focusable="false"'.$extra, $svg, 1) ?? $svg);
}
private static function clean(string $svg): string
{
$svg = trim($svg);
$svg = preg_replace('#<title\b[^>]*>.*?</title>#s', '', $svg) ?? $svg;
$svg = preg_replace('/\r?\n\s*/', '', $svg) ?? $svg;
return (string) preg_replace_callback('/^<svg\b[^>]*>/', function (array $root): string {
return (string) preg_replace('/\s(?:id|role|aria-labelledby|width|height)="[^"]*"/', '', $root[0]);
}, $svg);
}
private static function directory(string $set): string
{
if (! in_array($set, [self::SET_SYMBOLS, self::SET_GLYPHS], true)) {
throw new InvalidArgumentException("Unbekannter Symbolsatz „{$set}“.");
}
return resource_path("svg/brand/$set");
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@@ -19,6 +19,23 @@ ## 1. Favicon (umgesetzt)
- Die Verwaltung nutzt dasselbe Icon wie die Website. Soll sie sich im Tab unterscheiden (zum Beispiel Punkt oder Rahmen in Grün), wäre das eine eigene Variante. - Die Verwaltung nutzt dasselbe Icon wie die Website. Soll sie sich im Tab unterscheiden (zum Beispiel Punkt oder Rahmen in Grün), wäre das eine eigene Variante.
- Auf `luf-test` und `luf-prod` zeigt sich das Icon erst nach dem Deploy. Browser halten Favicons hartnäckig im Cache; ein Test im privaten Fenster ist aussagekräftiger. - Auf `luf-test` und `luf-prod` zeigt sich das Icon erst nach dem Deploy. Browser halten Favicons hartnäckig im Cache; ein Test im privaten Fenster ist aussagekräftiger.
## 1a. Stand der Umsetzung Stufe 1 und 2 (Branch `feature/kleingrafiken-symbole-tags`)
Umgesetzt:
- **Symbole:** 16 Symbole und Akzente liegen in `resources/svg/brand/symbole/` (unveränderte Kit-Dateien). `<x-brand.symbol name="filmklappe" />` bettet sie inline ein: Titel, ID, Rolle und feste Größe werden entfernt (keine doppelten IDs), `aria-hidden`, Größe über `.brand-symbol` (1,5 em). Ein unbekannter oder unsicherer Name wirft einen Fehler (`App\Support\Brand\Symbols`). Die festen Markenfarben der Kit-Dateien bleiben (sie entsprechen den Tokens); eine Umfärbung ist nicht vorgesehen und nicht nötig, solange es kein dunkles Thema gibt.
- **Tags:** `<x-brand.tag kind="film">Unterrichtsfilm</x-brand.tag>` als HTML/CSS-Pille mit Zeichen und echtem Text. Die Zeichen (`resources/svg/brand/glyphen/`) tragen die Geometrie aus den Tag-Dateien des Kits und nehmen ihre Farbe über `currentColor`. Neue Tokens `--lf-tag-…` in `tokens.css`.
- **Zuordnung:** `App\Domain\Catalog\MaterialTag::fromContent(Ausgabeklasse, Kennung der redaktionellen Art)`. Film (Ausgabeklasse film; Arten Unterrichtsfilm, Kurzfilm, Trailer, Interview), PDF (Ausgabeklasse pdf), Übung (Arten Arbeitsblatt, Übungsbeschreibung). Alles andere bekommt **kein** Tag und bleibt Text.
- **Eingebaut** in die öffentliche Premium-Karte für Medien (Art-Label). Die Beschriftung bleibt die redaktionelle Art („Merkblatt“, „Unterrichtsfilm“); Zeichen und Farbe folgen dem Schlüssel. Karten ohne eindeutigen Schlüssel zeigen die Art wie bisher als Text.
- **Kontrast gemessen** (WCAG-Formel): Marineblau auf `#CCE4FB` 11,6:1, `#28580F` auf `#D9EACD` 6,7:1 und auf `#E3EECF` 7,0:1, `#781A24` auf `#FFDAD9` 8,3:1, `#4F2D68` auf `#E8D9F4` 8,2:1; Zeichen `#145C9A` auf `#CCE4FB` 5,3:1 und `#A8212B` auf `#FFDAD9` 5,6:1; Weiß auf `#3B7B09` 5,2:1.
- **Beleg:** `16_Lara-Felix-Kleingrafiken/abnahme/symbole-und-tags-breit.png` und `…-schmal.png` (lokal gerendert aus den echten Komponenten und dem gebauten Stylesheet). Die Prüfung in der echten Anwendung auf `luf-test` steht noch aus.
Bewusst **nicht** umgesetzt:
- **`brand-rays` und `brand-underline` bleiben unverändert.** Sie sind in Hero, Premium-Karte und Katalogkarte mit eigener Größe, Drehung und Farbe eingebaut. Das Tauschen der Pfade verändert diese Stellen sichtbar und braucht einen Vorher-Nachher-Vergleich auf `luf-test`. Die freigegebenen Motive stehen als `signalstrahlen` und `gelbe-unterstreichung` zur Verfügung.
- **Mitgliederbereich unverändert.** Das freigegebene Design (Kit 14) hat eigene Art-Marken (grüne Großbuchstaben mit Linien-Symbol, `x-member.type`). Die pastellfarbenen Tags würden davon abweichen; ob sie dort gewollt sind, ist deine Entscheidung.
- **Katalogkarten (Programm/Modul) ohne Tag.** Es gibt keinen eindeutigen Schlüssel, und „Paket“ meint möglicherweise das Angebotspaket (Bundle) statt des Programms. „Film + Übungen“ und „Film + Merkblatt“ werden ebenfalls nicht automatisch vergeben. Die Komponente kann alle sechs Tags darstellen.
## 2. Bestandsaufnahme der 32 Motive ## 2. Bestandsaufnahme der 32 Motive
Technische Prüfung der SVG-Dateien (belegt durch Auswertung der Dateien, nicht nur Sichtprüfung): Technische Prüfung der SVG-Dateien (belegt durch Auswertung der Dateien, nicht nur Sichtprüfung):
+2
View File
@@ -7,6 +7,8 @@
@import './tokens.css'; @import './tokens.css';
@import './base.css'; @import './base.css';
@import './components.css'; @import './components.css';
/* Markensymbole und Material-Tags (Brand-Kit 16). */
@import './components/lf-brand.css';
@import './site.css'; @import './site.css';
@import './sections.css'; @import './sections.css';
@import './widgets.css'; @import './widgets.css';
+59
View File
@@ -0,0 +1,59 @@
/*
* Markensymbole und Material-Tags (Brand-Kit 16_Lara-Felix-Kleingrafiken).
* Nur Tokens aus tokens.css. Symbole sind dekorativ (aria-hidden); Tags tragen immer Text.
*/
.brand-symbol {
display: inline-block;
inline-size: 1.5em;
block-size: 1.5em;
flex: none;
vertical-align: -0.3em;
overflow: visible;
}
.brand-tag {
--brand-tag-bg: var(--lf-tag-combo-bg);
--brand-tag-ink: var(--lf-tag-combo-ink);
--brand-tag-glyph: var(--brand-tag-ink);
display: inline-flex;
align-items: center;
gap: 0.4em;
max-inline-size: 100%;
padding: 0.28em 0.8em 0.28em 0.55em;
border-radius: var(--radius-pill);
background: var(--brand-tag-bg);
color: var(--brand-tag-ink);
font-size: 0.875rem;
font-weight: 700;
line-height: 1.25;
overflow-wrap: anywhere;
}
.brand-tag__glyph {
inline-size: 1.45em;
block-size: 1.45em;
flex: none;
color: var(--brand-tag-glyph);
}
.brand-tag--film {
--brand-tag-bg: var(--lf-tag-film-bg);
--brand-tag-ink: var(--lf-navy);
--brand-tag-glyph: var(--lf-tag-film-glyph);
}
.brand-tag--uebung {
--brand-tag-bg: var(--lf-tag-exercise-bg);
--brand-tag-ink: var(--lf-tag-exercise-ink);
}
.brand-tag--pdf {
--brand-tag-bg: var(--lf-tag-pdf-bg);
--brand-tag-ink: var(--lf-tag-pdf-ink);
--brand-tag-glyph: var(--lf-tag-pdf-glyph);
}
.brand-tag--paket {
--brand-tag-bg: var(--lf-tag-package-bg);
--brand-tag-ink: var(--lf-tag-package-ink);
}
@@ -119,6 +119,12 @@ .lf-pc__kind {
text-transform: uppercase; text-transform: uppercase;
} }
/* Art als Material-Tag (Brand-Kit 16) statt Großbuchstaben-Text; die Beschriftung bleibt die redaktionelle Art. */
.lf-pc__kind--tag {
letter-spacing: 0;
text-transform: none;
}
.lf-pc .lf-pc__title { .lf-pc .lf-pc__title {
margin: 0; margin: 0;
color: var(--color-heading); color: var(--color-heading);
+13
View File
@@ -35,6 +35,19 @@ :root {
--lf-green-tint: #e8f0de; --lf-green-tint: #e8f0de;
--lf-yellow-tint: #fff4d6; --lf-yellow-tint: #fff4d6;
/* Material-Tags (Brand-Kit 16). Text je Paar mit mindestens 4,5:1, Zeichen mit mindestens 3:1 gegen die Fläche. */
--lf-tag-film-bg: #cce4fb;
--lf-tag-film-glyph: #145c9a;
--lf-tag-exercise-bg: #d9eacd;
--lf-tag-exercise-ink: #28580f;
--lf-tag-combo-bg: #e3eecf;
--lf-tag-combo-ink: #28580f;
--lf-tag-pdf-bg: #ffdad9;
--lf-tag-pdf-ink: #781a24;
--lf-tag-pdf-glyph: #a8212b;
--lf-tag-package-bg: #e8d9f4;
--lf-tag-package-ink: #4f2d68;
/* Ebene 2: Bedeutungswerte (heller Grund) */ /* Ebene 2: Bedeutungswerte (heller Grund) */
--color-text: var(--lf-ink); --color-text: var(--lf-ink);
--color-text-muted: var(--lf-ink-muted); --color-text-muted: var(--lf-ink-muted);
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><path d="M23 13 H57 L73 29 V82 H23Z M57 13 V29 H73 M34 42 H62 M34 54 H62 M34 66 H56" fill="none" stroke="currentColor" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 253 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><circle cx="48" cy="48" r="34" fill="currentColor"/><g transform="translate(14 12) scale(.75)"><path d="M37 26 Q37 22 41 24 L72 43 Q77 47 72 51 L41 70 Q37 73 37 68Z" fill="#FFFFFF"/></g></svg>

After

Width:  |  Height:  |  Size: 253 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect x="14" y="19" width="68" height="58" rx="5.5" fill="none" stroke="currentColor" stroke-width="4.5"/><path d="M29 20 V75 M67 20 V75 M15 39 H29 M15 58 H29 M67 39 H81 M67 58 H81 M29 48 H67" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 359 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><path d="M15 32 L48 15 L81 32 L48 50Z M15 32 V65 L48 82 L81 65 V32 M48 50 V82 M31 24 L64 41" fill="none" stroke="currentColor" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 261 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect x="17" y="15" width="64" height="66" rx="7" fill="none" stroke="currentColor" stroke-width="4.6"/><path d="M38 33 H65 M38 48 H65 M38 63 H65" fill="none" stroke="currentColor" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="29" cy="33" r="2.8" fill="currentColor"/><circle cx="29" cy="48" r="2.8" fill="currentColor"/><circle cx="29" cy="63" r="2.8" fill="currentColor"/></svg>

After

Width:  |  Height:  |  Size: 474 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Bildung</title>
<path d="M25 47 V64 C37 75 59 75 71 64 V47 M82 44 V65" fill="none" stroke="#032551" stroke-width="4.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 37 L48 22 L87 37 L48 53Z" fill="none" stroke="#3B7B09" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/><circle cx="82" cy="68" r="3.6" fill="#FCD10A" stroke="none" stroke-width="0"/>
</svg>

After

Width:  |  Height:  |  Size: 541 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Aufgeschlagenes Buch</title>
<path d="M19 29 C29 24 39 25 48 32 C57 25 67 24 77 29 V66 C65 62 55 64 48 70 C41 64 31 62 19 66Z M48 32 V70" fill="none" stroke="#032551" stroke-width="4.3" stroke-linecap="round" stroke-linejoin="round"/><path d="M19 33 H12 V75 C24 70 37 71 48 77 C59 71 72 70 84 75 V33 H77" fill="none" stroke="#3B7B09" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 560 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Download</title>
<path d="M16 55 V71 Q16 77 22 77 H74 Q80 77 80 71 V55 M48 17 V59 M33 44 L48 59 L63 44" fill="none" stroke="#032551" stroke-width="5.1" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 361 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Filmklappe</title>
<g transform="translate(0 5) rotate(-7 36 54)"><rect x="10" y="47" width="53" height="33" rx="4.7" fill="none" stroke="#032551" stroke-width="3.9"/><g transform="translate(16.9 44.8) scale(.38)"><path d="M37 26 Q37 22 41 24 L72 43 Q77 47 72 51 L41 70 Q37 73 37 68Z" fill="#032551"/></g><g transform="rotate(-11 11 48)"><rect x="10" y="36" width="53" height="12" rx="3.7" fill="none" stroke="#032551" stroke-width="3.8"/><path d="M16 46 L22 37 M27 47 L33 37 M39 47 L45 37 M51 47 L57 37" fill="none" stroke="#032551" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round"/></g></g><g transform="translate(61 2) rotate(8 16 20) scale(.86)"><path d="M5 23 L9 9 M16 26 L28 16 M20 35 L35 33" fill="none" stroke="#FCD10A" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/></g>
</svg>

After

Width:  |  Height:  |  Size: 977 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Filmstreifen</title>
<rect x="14" y="19" width="68" height="58" rx="5.5" fill="none" stroke="#032551" stroke-width="4.5"/><path d="M29 20 V75 M67 20 V75 M15 39 H29 M15 58 H29 M67 39 H81 M67 58 H81 M29 48 H67" fill="none" stroke="#032551" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 464 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 242 42" width="242" height="42" role="img" aria-labelledby="motif-title">
<title id="motif-title">Gelbe Unterstreichung</title>
<g transform="translate(2 0)"><path d="M8 30 C43 17 82 10 129 7 C161 5 199 6 229 10 C240 12 238 22 227 21 C156 14 79 20 11 35 C3 37 1 33 8 30Z" fill="#FCD10A"/></g>
</svg>

After

Width:  |  Height:  |  Size: 357 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Gruppe</title>
<path d="M27 53 C16 52 11 59 10 70 H25 M69 53 C80 52 85 59 86 70 H71" fill="none" stroke="#032551" stroke-width="4.1" stroke-linecap="round" stroke-linejoin="round"/><circle cx="24" cy="42" r="8.6" fill="none" stroke="#032551" stroke-width="4.1"/><circle cx="72" cy="42" r="8.6" fill="none" stroke="#032551" stroke-width="4.1"/><path d="M26 75 C27 60 35 56 48 56 C61 56 69 60 70 75Z" fill="none" stroke="#032551" stroke-width="4.3" stroke-linecap="round" stroke-linejoin="round"/><circle cx="48" cy="37" r="11.7" fill="none" stroke="#3B7B09" stroke-width="4.3"/>
</svg>

After

Width:  |  Height:  |  Size: 738 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Merkblatt</title>
<path d="M23 13 H57 L73 29 V82 H23Z M57 13 V29 H73 M34 42 H62 M34 54 H62 M34 66 H56" fill="none" stroke="#032551" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 360 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Muskelarm</title>
<path d="M28 51 C30 46 31 41 33 34 C29 34 26 31 27 27 C28 22 34 20 39 20 C45 20 51 23 52 29 C54 35 51 39 47 40 C43 42 39 40 37 38 C37 44 36 49 34 55 C40 51 46 52 51 56 C57 50 66 49 72 53 C79 57 81 67 77 75 C75 81 67 83 58 79 C47 83 32 83 21 80 C13 78 9 75 10 69 C11 60 15 51 18 43 C20 37 23 32 27 27" fill="none" stroke="#032551" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round"/><path d="M46 30 Q51 31 51 35 M31 56 Q30 59 28 61" fill="none" stroke="#032551" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/><g transform="translate(60 11) rotate(2 14 15) scale(.91)"><path d="M5 23 L9 9 M16 26 L28 16 M20 35 L35 33" fill="none" stroke="#FCD10A" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/></g>
</svg>

After

Width:  |  Height:  |  Size: 930 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Paket</title>
<path d="M15 32 L48 15 L81 32 L48 50Z M15 32 V65 L48 82 L81 65 V32 M48 50 V82 M31 24 L64 41" fill="none" stroke="#4F2D68" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 364 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Hand für die Denkpause</title>
<path d="M30 51 V31 C30 25 37 24 38 31 V45 V19 C38 13 46 13 46 19 V43 V15 C46 9 54 9 54 15 V43 V21 C54 15 62 15 62 21 V46 V29 C62 23 70 23 70 29 V58 C70 73 62 83 49 83 H44 C36 82 30 77 25 69 L17 56 C13 49 21 45 26 50 L34 58 L30 51Z" fill="#FFFFFF" stroke="#032551" stroke-width="4.25" stroke-linecap="round" stroke-linejoin="round"/><path d="M34 58 Q44 59 46 68" fill="none" stroke="#032551" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 652 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Wiedergabe</title>
<rect x="12" y="19" width="72" height="58" rx="13" fill="none" stroke="#032551" stroke-width="5.3"/><g transform="translate(10 10) scale(.79)"><path d="M37 26 Q37 22 41 24 L72 43 Q77 47 72 51 L41 70 Q37 73 37 68Z" fill="#FCD10A"/></g>
</svg>

After

Width:  |  Height:  |  Size: 414 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Schutzschild</title>
<path d="M48 12 C57 19 67 22 77 23 V45 C77 64 66 77 48 85 C30 77 19 64 19 45 V23 C29 22 39 19 48 12Z" fill="none" stroke="#3B7B09" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M34 47 L44 57 L63 37" fill="none" stroke="#032551" stroke-width="5.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 507 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 43" width="48" height="43" role="img" aria-labelledby="motif-title">
<title id="motif-title">Signalstrahlen</title>
<g transform="translate(4 0)"><path d="M5 23 L9 9 M16 26 L28 16 M20 35 L35 33" fill="none" stroke="#FCD10A" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/></g>
</svg>

After

Width:  |  Height:  |  Size: 363 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Sprechblase mit Fragezeichen</title>
<path d="M20 68 C12 62 8 55 8 45 C8 27 26 14 48 14 C71 14 88 28 88 45 C88 64 70 76 49 76 C45 76 41 76 37 75 C31 80 24 83 17 84 C20 79 23 73 23 70Z" fill="none" stroke="#3B7B09" stroke-width="4.6" stroke-linecap="round" stroke-linejoin="round"/><path d="M38 37 C39 27 59 27 59 38 C59 43 55 46 51 49 C48 52 48 54 48 56" fill="none" stroke="#3B7B09" stroke-width="5.7" stroke-linecap="round" stroke-linejoin="round"/><circle cx="48" cy="64" r="3.2" fill="#3B7B09" stroke="none" stroke-width="0"/>
</svg>

After

Width:  |  Height:  |  Size: 691 B

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96" role="img" aria-labelledby="motif-title">
<title id="motif-title">Übungsblatt</title>
<rect x="17" y="15" width="64" height="66" rx="7" fill="none" stroke="#032551" stroke-width="4.6"/><path d="M38 33 H65 M38 48 H65 M38 63 H65" fill="none" stroke="#032551" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="29" cy="33" r="2.8" fill="#3B7B09" stroke="none" stroke-width="0"/><circle cx="29" cy="48" r="2.8" fill="#3B7B09" stroke="none" stroke-width="0"/><circle cx="29" cy="63" r="2.8" fill="#3B7B09" stroke="none" stroke-width="0"/>
</svg>

After

Width:  |  Height:  |  Size: 657 B

@@ -0,0 +1,7 @@
{{--
Markensymbol aus dem Kit (resources/svg/brand/symbole), inline und rein dekorativ (aria-hidden).
Die Größe wird per Klasse oder Style gesetzt (Standard: 1.5em). Beispiel: <x-brand.symbol name="filmklappe" />.
Ein unbekannter Name wirft einen Fehler.
--}}
@props(['name'])
{!! \App\Support\Brand\Symbols::symbol($name, $attributes->class(['brand-symbol'])->toHtml()) !!}
@@ -0,0 +1,13 @@
{{--
Material-Tag (Brand-Kit 16, Gruppe D) als HTML/CSS-Pille: Zeichen plus echter Text.
kind: ein Wert von App\Domain\Catalog\MaterialTag. Ohne Inhalt steht die Standardbeschriftung; mit Inhalt der übergebene
Text, zum Beispiel die redaktionelle Art „Unterrichtsfilm“ (Zeichen und Farbe folgen dem Schlüssel, nicht dem Text).
--}}
@props(['kind'])
@php
$tag = $kind instanceof \App\Domain\Catalog\MaterialTag ? $kind : \App\Domain\Catalog\MaterialTag::from($kind);
@endphp
<span {{ $attributes->class(['brand-tag', 'brand-tag--'.$tag->value]) }}>
{!! \App\Support\Brand\Symbols::glyph($tag->glyph(), 'class="brand-tag__glyph"') !!}
<span class="brand-tag__text">@if ($slot->isEmpty()){{ $tag->label() }}@else{{ $slot }}@endif</span>
</span>
@@ -82,7 +82,11 @@
@endif @endif
<div class="lf-pc__body"> <div class="lf-pc__body">
@if (empty($bare) && $show['kind'] && $subject->kind !== '') @if (empty($bare) && $show['kind'] && $subject->kind !== '')
<p class="lf-pc__kind">{{ $subject->kind }}</p> @if ($subject->tag !== null)
<p class="lf-pc__kind lf-pc__kind--tag"><x-brand.tag :kind="$subject->tag">{{ $subject->kind }}</x-brand.tag></p>
@else
<p class="lf-pc__kind">{{ $subject->kind }}</p>
@endif
@endif @endif
<{{ $headingTag }} @class(['lf-pc__title', 'visually-hidden' => ! empty($bare)])>{{ $subject->title }}</{{ $headingTag }}> <{{ $headingTag }} @class(['lf-pc__title', 'visually-hidden' => ! empty($bare)])>{{ $subject->title }}</{{ $headingTag }}>
@if (empty($bare) && $show['summary'] && filled($subject->summary)) @if (empty($bare) && $show['summary'] && filled($subject->summary))
+3 -1
View File
@@ -188,7 +188,9 @@ public function test_media_card_is_public_only_as_part_of_a_public_program_and_n
// Material: eigene Darstellung mit Materialsymbol. // Material: eigene Darstellung mit Materialsymbol.
$this->assertStringContainsString('lf-pc lf-pc--material', $main); $this->assertStringContainsString('lf-pc lf-pc--material', $main);
$this->assertStringContainsString('lf-pc__panel lf-pc__panel--material', $main); $this->assertStringContainsString('lf-pc__panel lf-pc__panel--material', $main);
$this->assertStringContainsString('<p class="lf-pc__kind">Merkblatt</p>', $main); // Ausgabeklasse pdf: die Art steht als PDF-Tag, die Beschriftung bleibt die redaktionelle Art.
$this->assertStringContainsString('brand-tag brand-tag--pdf', $main);
$this->assertMatchesRegularExpression('#<span class="brand-tag__text">\s*Merkblatt\s*</span>#', $main);
$this->assertStringContainsString('Ein Blatt für Eltern.', $main); $this->assertStringContainsString('Ein Blatt für Eltern.', $main);
// Vertraulich und nicht öffentlich genannt: öffentlich nicht sichtbar. // Vertraulich und nicht öffentlich genannt: öffentlich nicht sichtbar.
$this->assertStringNotContainsString('Traineranleitung Abstand', $main, 'Traineranleitungen erscheinen nie öffentlich.'); $this->assertStringNotContainsString('Traineranleitung Abstand', $main, 'Traineranleitungen erscheinen nie öffentlich.');
@@ -84,6 +84,19 @@ public function test_a_released_website_film_shows_publicly_with_its_clip_and_wi
$this->assertStringNotContainsString('originals/', $html); $this->assertStringNotContainsString('originals/', $html);
} }
public function test_a_film_card_shows_its_kind_as_a_film_tag_with_text(): void
{
$teaser = $this->websiteFilm('Teaser Denkpause');
$this->release($teaser);
$this->publish('/teaser-tag', $teaser);
$html = $this->get('/teaser-tag')->assertOk()->getContent();
$this->assertStringContainsString('brand-tag brand-tag--film', $html);
$this->assertMatchesRegularExpression('#<span class="brand-tag__text">\s*Film\s*</span>#', $html, 'Das Tag trägt echten Text.');
$this->assertSame(1, substr_count($html, 'lf-pc__kind--tag'));
}
public function test_an_unreleased_website_film_stays_out_of_the_public_page_but_shows_in_the_preview(): void public function test_an_unreleased_website_film_stays_out_of_the_public_page_but_shows_in_the_preview(): void
{ {
$teaser = $this->websiteFilm('Teaser Denkpause'); $teaser = $this->websiteFilm('Teaser Denkpause');
+77
View File
@@ -0,0 +1,77 @@
<?php
namespace Tests\Unit;
use App\Support\Brand\Symbols;
use Illuminate\Support\Facades\Blade;
use InvalidArgumentException;
use Tests\TestCase;
/**
* Kleingrafiken des Brand-Kits (resources/svg/brand): vollständig, ohne doppelte IDs, rein dekorativ.
*/
class BrandSymbolsTest extends TestCase
{
public function test_every_kit_symbol_is_available_and_every_name_renders(): void
{
$expected = [
'bildung', 'buch', 'download', 'filmklappe', 'filmstreifen', 'gelbe-unterstreichung', 'gruppe', 'merkblatt',
'muskelarm', 'paket', 'pause-hand', 'play', 'schutzschild', 'signalstrahlen', 'sprechblase-fragezeichen', 'uebungsblatt',
];
$this->assertSame($expected, Symbols::names());
foreach (Symbols::names() as $name) {
$this->assertStringStartsWith('<svg aria-hidden="true" focusable="false"', (string) Symbols::symbol($name), $name);
}
foreach (Symbols::names(Symbols::SET_GLYPHS) as $name) {
$this->assertStringContainsString('currentColor', (string) Symbols::glyph($name), $name);
}
}
public function test_the_kit_ids_titles_and_fixed_sizes_are_removed_so_several_symbols_do_not_clash(): void
{
$html = Blade::render('<x-brand.symbol name="filmklappe" /><x-brand.symbol name="buch" /><x-brand.symbol name="paket" />');
$this->assertStringNotContainsString('motif-title', $html);
$this->assertStringNotContainsString('<title', $html);
$this->assertStringNotContainsString('aria-labelledby', $html);
$this->assertStringNotContainsString('role="img"', $html);
$this->assertDoesNotMatchRegularExpression('/<svg[^>]*\s(?:width|height)=/', $html, 'Keine feste Größe am Wurzelelement.');
$this->assertSame(3, substr_count($html, 'aria-hidden="true"'));
$this->assertSame(3, substr_count($html, 'class="brand-symbol"'));
$this->assertSame(3, substr_count($html, 'viewBox='));
}
public function test_attributes_of_the_component_are_kept_and_escaped(): void
{
$html = Blade::render('<x-brand.symbol name="play" class="extra" :data-x="$value" />', ['value' => 'a"b']);
$this->assertStringContainsString('class="brand-symbol extra"', $html);
$this->assertStringContainsString('data-x="a&quot;b"', $html);
}
public function test_an_unknown_or_unsafe_name_is_an_error(): void
{
foreach (['gibt-es-nicht', '../symbole/buch', 'Buch', ''] as $name) {
try {
Symbols::symbol($name);
$this->fail("Name „{$name}“ hätte abgewiesen werden müssen.");
} catch (InvalidArgumentException) {
$this->addToAssertionCount(1);
}
}
}
public function test_the_symbol_files_contain_no_text_and_no_scripts(): void
{
foreach ([Symbols::SET_SYMBOLS, Symbols::SET_GLYPHS] as $set) {
foreach (Symbols::names($set) as $name) {
$svg = (string) file_get_contents(resource_path("svg/brand/$set/$name.svg"));
$this->assertDoesNotMatchRegularExpression('/<(text|script|image|foreignObject|style)\b/i', $svg, "$set/$name");
$this->assertDoesNotMatchRegularExpression('/\son\w+=/i', $svg, "$set/$name");
}
}
}
}
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace Tests\Unit;
use App\Domain\Catalog\MaterialTag;
use App\Support\Brand\Symbols;
use Illuminate\Support\Facades\Blade;
use Tests\TestCase;
class MaterialTagTest extends TestCase
{
public function test_the_mapping_follows_keys_not_labels(): void
{
$this->assertSame(MaterialTag::Film, MaterialTag::fromContent('film'));
$this->assertSame(MaterialTag::Pdf, MaterialTag::fromContent('pdf'));
$this->assertSame(MaterialTag::Film, MaterialTag::fromContent('document', 'unterrichtsfilm'));
$this->assertSame(MaterialTag::Film, MaterialTag::fromContent(null, 'trailer'));
$this->assertSame(MaterialTag::Uebung, MaterialTag::fromContent('document', 'arbeitsblatt'));
$this->assertSame(MaterialTag::Uebung, MaterialTag::fromContent(null, 'uebungsbeschreibung'));
}
public function test_what_is_not_clear_gets_no_tag(): void
{
$this->assertNull(MaterialTag::fromContent('document'), 'Ein Dokument ist nicht automatisch ein PDF.');
$this->assertNull(MaterialTag::fromContent('audio', 'audioanleitung'));
$this->assertNull(MaterialTag::fromContent(null, 'programm'));
$this->assertNull(MaterialTag::fromContent(null, 'modul'));
$this->assertNull(MaterialTag::fromContent(null, null));
$this->assertNull(MaterialTag::fromContent('bild', 'Unterrichtsfilm'), 'Eine Beschriftung ist kein Schlüssel.');
}
public function test_every_tag_has_a_label_and_an_existing_glyph(): void
{
foreach (MaterialTag::cases() as $tag) {
$this->assertNotSame('', $tag->label());
$this->assertContains($tag->glyph(), Symbols::names(Symbols::SET_GLYPHS), $tag->value);
}
}
public function test_the_component_shows_real_text_with_a_decorative_glyph(): void
{
$default = Blade::render('<x-brand.tag kind="film-uebungen" />');
$this->assertStringContainsString('brand-tag brand-tag--film-uebungen', $default);
$this->assertStringContainsString('>Film + Übungen</span>', $default);
$this->assertStringContainsString('aria-hidden="true"', $default);
$custom = Blade::render('<x-brand.tag :kind="$kind">Unterrichtsfilm</x-brand.tag>', ['kind' => MaterialTag::Film]);
$this->assertStringContainsString('brand-tag--film', $custom);
$this->assertStringContainsString('>Unterrichtsfilm</span>', $custom);
$this->assertStringNotContainsString('>Film</span>', $custom, 'Die redaktionelle Art ersetzt die Standardbeschriftung.');
$escaped = Blade::render('<x-brand.tag kind="pdf">{{ $text }}</x-brand.tag>', ['text' => '<b>x</b>']);
$this->assertStringNotContainsString('<b>x</b>', $escaped);
}
}