Integriere die Premium-Karten v1.7 als Themen-, Medien- und Programmkarte.
- Drei Widget-Arten (topic_card, media_card, program_card) auf gemeinsamer Basis, eine Karte je Platz im bestehenden Abschnittsraster; kein zweites Kartenraster. - Titel, Kurzbeschreibung, Art, Zusatzangaben und Linkziel kommen zur Laufzeit aus Thema, Inhaltselement bzw. Programm/Modul; im CMS stehen nur Kennungen, Bild, Bildausschnitt, Beschriftung und Hinweis. - Medienkarten sind öffentlich nur als Bestandteil eines öffentlichen Programms (PublicMaterialReader), Module nur in der Redaktionsvorschau; keine Bibliotheksbilder, kein Preis, keine Kaufaktion. - Gleiche Höhe je Zeile über die gemeinsame Höhe „fill“; Raster 1 + 1 + 2 und 2 + 1 + 1 ergänzt. - Tests zu Raster- und Widgetliste bewusst um die neuen Raster und Arten erweitert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cca069be48
commit
127ea86817
16 files changed
+1579
-3
No files matched your search
@@ -171,6 +171,44 @@ public function entries(array $refs, bool $includeNonPublic): array
|
||||
return $entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anzeigedaten für eine Programm- oder Modulkarte (Premium-Karte). Dieselbe Regel wie entries():
|
||||
* Programme mit Anzeigefreigabe öffentlich mit Programmseite, Module nur in der Redaktionsvorschau.
|
||||
* Die Art („Programm“ oder „Modul“) ist immer benannt. Kein Preis, kein Angebot, keine Kaufaktion.
|
||||
*/
|
||||
public function subject(mixed $id, bool $includeNonPublic): ?CardSubject
|
||||
{
|
||||
$entry = $this->entries([['type' => 'composition', 'id' => $id]], $includeNonPublic)[0] ?? null;
|
||||
|
||||
if ($entry === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$meta = [];
|
||||
$composition = Composition::query()->find($entry->id);
|
||||
$version = $composition !== null ? $this->shownVersion($composition) : null;
|
||||
|
||||
if ($version !== null) {
|
||||
$nested = $version->members()->whereNotNull('nested_composition_version_id')->with('nestedCompositionVersion.composition.editorialContentKind')->get();
|
||||
$modules = $nested->filter(fn ($member): bool => $member->nestedCompositionVersion?->composition?->editorialContentKind?->slug === 'modul')->count();
|
||||
|
||||
if ($modules > 0) {
|
||||
$meta[] = $modules === 1 ? '1 Modul' : $modules.' Module';
|
||||
}
|
||||
}
|
||||
|
||||
return new CardSubject(
|
||||
title: $entry->title,
|
||||
summary: $entry->summary,
|
||||
kind: $entry->kindLabel,
|
||||
badge: null,
|
||||
meta: $meta,
|
||||
url: $entry->url,
|
||||
public: $entry->public,
|
||||
notice: $entry->public ? null : 'Nur in der Redaktionsvorschau sichtbar: Für Module gibt es noch keine öffentliche Seitenart (öffentliches Profil, ADR-29).',
|
||||
);
|
||||
}
|
||||
|
||||
private function title(Composition $composition): string
|
||||
{
|
||||
return (string) ($composition->display_title ?: $composition->designation);
|
||||
|
||||
Reference in new issue
Block a user