Führe develop in den Branch zusammen; Abschnittseinstellungen tragen ADR-64, ADR-63 bleibt bei den Bildfassungen
CI Feature / test (push) Successful in 5m56s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-28 10:01:29 +01:00
commit 61c7c5c3d3
58 files changed
+1035 -84

No files matched your search

@@ -319,7 +319,7 @@ public function subject(mixed $id, bool $includeNonPublic): ?CardSubject
notice: $notice,
visual: 'catalog',
visualLabel: $kind,
previewImage: $includeNonPublic ? ThumbnailRef::url('editorial.card', 'komposition', (int) $composition->id, $composition->thumbnail_path) : null,
previewImage: $includeNonPublic ? ThumbnailRef::url('editorial.card', 'komposition', (int) $composition->id, $composition->thumbnail_path, 'mittel', $composition->updated_at) : null,
missing: $missing,
texts: $texts,
);
@@ -221,7 +221,7 @@ public function subject(mixed $id, bool $includeNonPublic, array $draft = []): ?
$missing[] = 'Kein Anzeigetitel gepflegt; die Karte zeigt den Arbeitstitel.';
}
$previewImage = $includeNonPublic ? ThumbnailRef::url('editorial.card', 'element', (int) $element->id, $shown->thumbnail_path) : null;
$previewImage = $includeNonPublic ? ThumbnailRef::url('editorial.card', 'element', (int) $element->id, $shown->thumbnail_path, 'mittel', $shown->updated_at) : null;
return new CardSubject(
title: $title,
+1 -1
View File
@@ -115,7 +115,7 @@ private function renderSection(array $section, array $cells, int $index, RenderC
$style = SectionStyle::fromStored($section['style'] ?? []);
$columns = SectionLayouts::columns(array_column($cells, 'units'));
// Hintergrundbild aus dem Medienmanager: öffentlich nur mit Website-Freigabe (WebsiteImage → WebsiteMedia).
$imageUrl = $style['background'] === 'image' ? app(WebsiteImage::class)->url($style['image'], $context->preview) : null;
$imageUrl = $style['background'] === 'image' ? app(WebsiteImage::class)->url($style['image'], $context->preview, 1920) : null;
$hasImage = $imageUrl !== null;
$classes = [
+22 -13
View File
@@ -86,7 +86,7 @@ public function elementId(mixed $value): ?int
return is_int($id) ? $id : null;
}
public function presentation(mixed $value): ?WebsitePresentation
public function presentation(mixed $value, ?ContentElement $loaded = null): ?WebsitePresentation
{
$id = $this->elementId($value);
@@ -95,7 +95,8 @@ public function presentation(mixed $value): ?WebsitePresentation
}
if (! array_key_exists($id, $this->presentations)) {
$this->presentations[$id] = $this->media->present($id) ?? false;
// Ein schon geladenes Medium wird weitergereicht (kein zweiter Zugriff je Eintrag in der Auswahl).
$this->presentations[$id] = $this->media->present($loaded?->getKey() === $id ? $loaded : $id) ?? false;
}
return $this->presentations[$id] ?: null;
@@ -105,12 +106,12 @@ public function presentation(mixed $value): ?WebsitePresentation
* Bildadresse für die Darstellung. Öffentlich nur freigegebene Medien (oder frühere CMS-Bilder ohne Zuordnung);
* in der Redaktionsvorschau zusätzlich das Vorschaubild eines nicht freigegebenen Mediums.
*/
public function url(mixed $value, bool $preview = false): ?string
public function url(mixed $value, bool $preview = false, ?int $width = null): ?string
{
$presentation = $this->presentation($value);
if ($presentation !== null) {
return $presentation->kind === 'bild' ? $presentation->url : null;
return $presentation->kind === 'bild' ? $presentation->urlForWidth($width) : null;
}
$id = $this->elementId($value);
@@ -122,7 +123,7 @@ public function url(mixed $value, bool $preview = false): ?string
$element = ContentElement::query()->find($id);
return $element === null ? null : ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path);
return $element === null ? null : ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path, 'mittel', $element->updated_at);
}
$legacy = self::normalize($value);
@@ -134,6 +135,14 @@ public function url(mixed $value, bool $preview = false): ?string
return is_string($legacy) ? PublicMedia::url($legacy) : null;
}
/** `srcset` des freigegebenen Bildes (mehrere Breiten), sonst null. Für Hero, Bild mit Text, Karten. */
public function srcset(mixed $value): ?string
{
$presentation = $this->presentation($value);
return $presentation !== null && $presentation->kind === 'bild' ? $presentation->srcset : null;
}
/** Alternativtext: Angabe im Widget, sonst der Alternativtext des Mediums. */
public function alt(mixed $value, mixed $override = null): string
{
@@ -169,7 +178,7 @@ public function previewNotice(mixed $value, string $label = 'Das gewählte Bild'
*
* @return array{public: bool, state: string, title: string, note: string, thumb: ?string, manageUrl: ?string}|null
*/
public function status(mixed $value): ?array
public function status(mixed $value, ?ContentElement $loaded = null): ?array
{
$value = self::normalize($value);
@@ -194,16 +203,16 @@ public function status(mixed $value): ?array
];
}
$element = ContentElement::query()->with('editorialContentKind')->find($id);
$element = $loaded?->getKey() === $id ? $loaded : ContentElement::query()->with('editorialContentKind')->find($id);
if ($element === null) {
return ['public' => false, 'state' => 'missing', 'title' => 'Medium '.$id, 'note' => 'Das Medium gibt es nicht mehr.', 'thumb' => null, 'manageUrl' => null];
}
$title = (string) ($element->display_title ?: $element->working_title);
$thumb = ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path);
$thumb = ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path, 'klein', $element->updated_at);
$manageUrl = ContentElementResource::getUrl('view', ['record' => $element]);
$public = $this->presentation($id) !== null;
$public = $this->presentation($id, $element) !== null;
$note = match (true) {
$public => 'Für die Website freigegeben.',
@@ -292,7 +301,7 @@ public function options(?string $search = null, int $limit = 60): array
$options = [];
foreach ($elements as $element) {
if (self::isSelectable($element)) {
$options[$element->id] = $this->optionHtml($element->id);
$options[$element->id] = $this->optionHtml($element->id, $element);
}
}
@@ -300,9 +309,9 @@ public function options(?string $search = null, int $limit = 60): array
}
/** HTML-Bezeichnung einer Option oder des gewählten Werts (auch für frühere Pfade). */
public function optionHtml(mixed $value): ?string
public function optionHtml(mixed $value, ?ContentElement $loaded = null): ?string
{
$status = $this->status($value);
$status = $this->status($value, $loaded);
if ($status === null) {
return null;
@@ -315,7 +324,7 @@ public function optionHtml(mixed $value): ?string
default => ['warn', 'Website: nicht freigegeben'],
};
$thumb = $status['thumb'] !== null
? '<img src="'.e($status['thumb']).'" alt="" loading="lazy">'
? '<img src="'.e($status['thumb']).'" alt="" loading="lazy" decoding="async">'
: '<span class="luf-media-option-empty" aria-hidden="true"></span>';
return '<span class="luf-media-option">'.$thumb
@@ -302,6 +302,7 @@ public function resolve(array $widget, RenderContext $context): array
'linkLabel' => filled($item['link_label'] ?? null) ? $item['link_label'] : self::DEFAULT_LINK_LABEL,
'symbol' => HeadingAccent::symbol(['symbol' => $item['symbol'] ?? null]),
'imageUrl' => $images->url($item['image'] ?? null, $context->preview),
'imageSrcset' => $images->srcset($item['image'] ?? null),
];
if ($context->preview && ($notice = $images->previewNotice($item['image'] ?? null, 'Das Bild der Karte „'.$item['title'].'“')) !== null) {
@@ -250,6 +250,7 @@ public function resolve(array $widget, RenderContext $context): array
return [
'video' => $video,
'imageUrl' => $images->url($image, $context->preview),
'imageSrcset' => $images->srcset($image),
'imageAlt' => $images->alt($image, $widget['data']['alt'] ?? null),
'imageNotice' => $context->preview ? $images->previewNotice($image) : null,
'actions' => $actions,
@@ -329,6 +329,7 @@ public function resolve(array $widget, RenderContext $context): array
return [
'imageUrl' => $imageUrl,
'imageSrcset' => $imageUrl === null ? null : $images->srcset($image),
'imageAlt' => $imageAlt,
'imageNotice' => $context->preview ? $images->previewNotice($image) : null,
'video' => $video,
@@ -130,7 +130,7 @@ protected function filmFieldData(?ContentElement $film): array
? route('content.website-frame', ['element' => $film])
: null,
'filmHasThumbnail' => $film instanceof ContentElement && is_string($film->thumbnail_path) && $film->thumbnail_path !== '',
'filmThumbnailUrl' => $film instanceof ContentElement ? ThumbnailRef::url('editorial.card', 'element', (int) $film->id, $film->thumbnail_path) : null,
'filmThumbnailUrl' => $film instanceof ContentElement ? ThumbnailRef::url('editorial.card', 'element', (int) $film->id, $film->thumbnail_path, 'mittel', $film->updated_at) : null,
'filmStartSecond' => $film instanceof ContentElement ? ($stills->thumbnailSecond($film) ?? '0') : '0',
];
}
@@ -349,6 +349,7 @@ public function resolve(array $widget, RenderContext $context): array
'clip' => $clip,
'cardStyle' => $subject?->style ?? $this->cardStyle(),
'imageUrl' => app(WebsiteImage::class)->url($imageRef, $context->preview),
'imageSrcset' => app(WebsiteImage::class)->srcset($imageRef),
'alt' => app(WebsiteImage::class)->alt($imageRef, $data['alt'] ?? null),
'imageNotice' => $context->preview ? app(WebsiteImage::class)->previewNotice($imageRef, 'Das Kartenbild') : null,
'focus' => PremiumFields::focus($data, 66, 45),
@@ -65,7 +65,7 @@ protected function imageSourceFields(): array
'composition' => $composition,
'compositionTitle' => $composition instanceof Composition ? (string) ($composition->display_title ?: $composition->designation) : '',
'compositionThumbnailUrl' => $composition instanceof Composition && app(CompositionStill::class)->hasThumbnail($composition)
? ThumbnailRef::url('editorial.card', 'komposition', (int) $composition->id, $composition->thumbnail_path)
? ThumbnailRef::url('editorial.card', 'komposition', (int) $composition->id, $composition->thumbnail_path, 'mittel', $composition->updated_at)
: null,
];
}),