Files
laraundfelix/resources/views/widgets/premium_card.blade.php
T
LarsandClaude Opus 5.5 a08067c078 Mache die Premium-Karten mit vorhandenen Fachobjekten nutzbar.
- Themenkarte: alle Säulen wählbar; nicht veröffentlichte nur in der Redaktionsvorschau.
- Medienkarte: Kurzbeschreibung, Film (Filmtafel, Hinweis auf den geschützten Film) und Material
  (Materialsymbol) getrennt; Filmstandbild der Bibliothek nur in der Redaktionsvorschau, markiert;
  Entwürfe wählbar, gesperrte nicht; Traineranleitungen nie öffentlich.
- Programm-/Modulkarte: Lernziel als Text, Dauer und Modulzahl; Programme/Module ohne Anzeigefreigabe
  für die Vorschau wählbar; Module weiterhin ohne Link.
- Fehlende Inhalte nur in der Vorschau als eingeklappte Redaktionshinweise.
- Tests bewusst angepasst: Medien zeigen jetzt die Kurzbeschreibung (Betreibervorgabe), unveröffentlichte
  Themen und Programme ohne Freigabe sind wählbar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:20:40 +01:00

108 lines
6.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{--
Premium-Karte (Brand-UI-Kit v1.7, Entwurf zur visuellen Freigabe) für Themen-, Medien-, Material- und Programmkarten.
Alle Texte und das Linkziel kommen aus $subject (Fachdaten zur Laufzeit, PublicCatalogReader/PublicMaterialReader);
redaktionell sind nur Kartenbild, Alternativtext, Bildausschnitt, Beschriftung der Aktion und Hinweis.
Bildbereich, in dieser Reihenfolge:
1. Kartenbild aus dem öffentlichen Website-Bereich (Reiter „Medien“) – öffentlich und in der Vorschau.
2. Nur Redaktionsvorschau: Vorschaubild der Bibliothek (Filmstandbild, Modulvorschau), deutlich als nicht
öffentlich markiert. Es hat keine Freigabe für die Website und wird öffentlich nie ausgegeben.
3. Tafel nach Fachobjekt: Programm/Modul (Navy), Film (Filmtafel), Material (Materialsymbol); Thema ohne Bildbereich.
Hinweise auf fehlende Inhalte stehen nur in der Redaktionsvorschau, öffentlich nie.
--}}
@if ($subject === null)
@if ($context->preview)
<p class="preview-note">Kein Objekt verknüpft, oder das verknüpfte Objekt ist archiviert beziehungsweise gesperrt. Öffentlich erscheint diese Karte nicht.</p>
@endif
@elseif ($subject->public || $context->preview)
@php
$libraryImage = $imageUrl === null && $context->preview ? $subject->previewImage : null;
$panel = $imageUrl === null && $libraryImage === null ? $subject->visual : null;
$action = $show['action'] && $subject->url !== null ? ['url' => $subject->url, 'label' => $actionLabel] : null;
$meta = $show['meta'] ? $subject->meta : [];
$hints = $subject->missing;
$panelName = ['catalog' => 'die Navy-Tafel', 'film' => 'die Filmtafel', 'material' => 'das Materialsymbol'][$subject->visual] ?? 'die Karte ohne Bild';
if ($context->preview && $imageUrl === null) {
$hints[] = $subject->previewImage !== null
? 'Das Vorschaubild der Bibliothek ist nicht für die Website freigegeben; öffentlich erscheint stattdessen '.$panelName.'. Ein freigegebenes Motiv kann im Reiter „Medien“ als Kartenbild gewählt werden.'
: 'Kein Kartenbild gewählt; öffentlich erscheint '.$panelName.' (Kartenbild im Reiter „Medien“).';
}
@endphp
<article @class([
'lf-pc',
'lf-pc--'.$cardStyle,
'lf-pc--'.$format,
'lf-pc--'.$fit,
'lf-pc--stacked' => $stacked,
'lf-pc--without-visual' => $imageUrl === null && $libraryImage === null && $panel === null,
'lf-pc--internal' => ! $subject->public,
]) style="--pc-focus-x: {{ $focus['x'] }}%; --pc-focus-y: {{ $focus['y'] }}%">
@if ($imageUrl !== null || $libraryImage !== null)
<div class="lf-pc__visual">
<img class="lf-pc__image" src="{{ $imageUrl ?? $libraryImage }}" alt="{{ $imageUrl !== null ? $alt : '' }}" loading="lazy" decoding="async">
@if ($show['kind'] && $subject->badge !== null)
<span class="lf-pc__badge">{{ $subject->badge }}</span>
@endif
@if ($libraryImage !== null)
<span class="lf-pc__library-flag">Bibliotheksbild · nur Vorschau</span>
@endif
</div>
@elseif ($panel !== null)
<div class="lf-pc__panel lf-pc__panel--{{ $panel }}" aria-hidden="true">
@if ($panel === 'film')
<svg class="lf-pc__panel-icon" viewBox="0 0 48 48" focusable="false"><rect x="6" y="10" width="36" height="28" rx="4" fill="none" stroke="currentColor" stroke-width="3"/><path d="M6 17h36M6 31h36M14 10v7M22 10v7M30 10v7M38 10v7M14 31v7M22 31v7M30 31v7M38 31v7" stroke="currentColor" stroke-width="2.5"/></svg>
@elseif ($panel === 'material')
<svg class="lf-pc__panel-icon" viewBox="0 0 48 48" focusable="false"><path d="M12 5h17l9 9v29H12z" fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"/><path d="M29 5v9h9M18 24h14M18 30h14M18 36h9" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
@endif
<span class="lf-pc__panel-label">{{ $subject->visualLabel ?? $subject->kind }}</span>
<x-brand.underline class="lf-pc__panel-accent" />
</div>
@endif
<div class="lf-pc__body">
@if ($show['kind'] && $subject->kind !== '')
<p class="lf-pc__kind">{{ $subject->kind }}</p>
@endif
<{{ $headingTag }} class="lf-pc__title">{{ $subject->title }}</{{ $headingTag }}>
@if ($show['summary'] && filled($subject->summary))
<p class="lf-pc__summary">{{ $subject->summary }}</p>
@endif
@if ($meta !== [])
<ul class="lf-pc__meta" aria-label="Weitere Angaben">
@foreach ($meta as $item)
<li>{{ $item }}</li>
@endforeach
</ul>
@endif
@if ($action !== null || $note !== null)
<div class="lf-pc__footer">
@if ($note !== null)
<p class="lf-pc__note">{{ $note }}</p>
@endif
@if ($action !== null)
<a class="lf-pc__cta" href="{{ $action['url'] }}">{{ $action['label'] }}</a>
@endif
</div>
@endif
@if ($context->preview && (! $subject->public || $hints !== []))
@unless ($subject->public)
<p class="lf-pc__private-flag">Nur Redaktionsvorschau</p>
@endunless
<details class="preview-note lf-pc__editorial">
<summary>Hinweise für die Redaktion ({{ count($hints) + ($subject->public ? 0 : 1) }})</summary>
@if (! $subject->public && $subject->notice !== null)
<p>{{ $subject->notice }}</p>
@endif
@if ($hints !== [])
<p>Für eine vollständige Karte fehlt:</p>
<ul>
@foreach ($hints as $hint)
<li>{{ $hint }}</li>
@endforeach
</ul>
@endif
</details>
@endif
</div>
</article>
@endif