Web-Frontend: Kartenkomponenten auf PressRelease-Helper umgestellt (R4.3)

@php-Bloecke von feed-item, feed-top-item, focus-side-item, focus-hero,
kategorie, newsroom, release-detail, veroeffentlichen nutzen die neuen
Model-Helper — gerendertes Markup unveraendert (Web-Suite 215 gruen).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-10 11:57:26 +00:00
parent 01e175e138
commit 3843e534da
8 changed files with 27 additions and 50 deletions

View file

@ -4,9 +4,7 @@
])
@php
$category = $release?->category?->translations?->firstWhere('locale', app()->getLocale())
?? $release?->category?->translations?->first();
$categoryName = $category?->name;
$categoryName = $release?->localizedCategoryName();
$company = $release?->company?->name;
$city = $release?->company?->city ?? null;
$title = $release->title;

View file

@ -3,21 +3,16 @@
])
@php
$category = $release?->category?->translations?->firstWhere('locale', app()->getLocale())
?? $release?->category?->translations?->first();
$categoryName = $category?->name;
$image = $release?->images?->first();
$imageUrl = $image?->variantUrl('card') ?? $image?->url();
$categoryName = $release?->localizedCategoryName();
$imageUrl = $release?->cardImageUrl();
$placeholderUrl = $imageUrl ? null : $release?->chosenPlaceholderUrl();
$teaser = (string) \Illuminate\Support\Str::of(strip_tags((string) ($release?->text ?? '')))->squish()->limit(180);
$teaser = $release?->teaserText(180) ?? '';
$company = $release?->company?->name;
$title = $release->title;
$href = route('release.detail', ['slug' => $release->slug]);
$time = $release?->published_at?->isToday()
? $release->published_at->format('H:i')
: ($release?->published_at?->isYesterday() ? __('web.shared.yesterday') : $release?->published_at?->isoFormat('D. MMM'));
$time = $release?->compactPublishedLabel();
$city = $release?->company?->city ?? null;
$readTime = max(1, (int) round(str_word_count(strip_tags((string) ($release?->text ?? ''))) / 200));
$readTime = $release?->readTimeMinutes() ?? 1;
@endphp
<article class="py-6 border-b border-bg-rule grid gap-6 grid-cols-1 md:grid-cols-[240px_1fr] group">

View file

@ -7,17 +7,14 @@
$sideReleases = collect($sideReleases)->take(4)->values();
if ($leadRelease) {
$leadCategory = $leadRelease->category?->translations?->firstWhere('locale', app()->getLocale())
?? $leadRelease->category?->translations?->first();
$leadCategoryName = $leadCategory?->name;
$leadImage = $leadRelease->images?->first();
$leadImageUrl = $leadImage?->variantUrl('card') ?? $leadImage?->url();
$leadCategoryName = $leadRelease->localizedCategoryName();
$leadImageUrl = $leadRelease->cardImageUrl();
$leadPlaceholderUrl = $leadImageUrl ? null : $leadRelease->chosenPlaceholderUrl();
$leadTitle = $leadRelease->title;
$leadTeaser = (string) \Illuminate\Support\Str::of(strip_tags((string) $leadRelease->text))->squish()->limit(200);
$leadTeaser = $leadRelease->teaserText(200);
$leadCompany = $leadRelease->company?->name;
$leadHref = route('release.detail', ['slug' => $leadRelease->slug]);
$leadReadTime = max(1, (int) round(str_word_count(strip_tags((string) $leadRelease->text)) / 200));
$leadReadTime = $leadRelease->readTimeMinutes();
$leadPublishedAt = $leadRelease->published_at;
}
@endphp

View file

@ -5,17 +5,12 @@
])
@php
$category = $release?->category?->translations?->firstWhere('locale', app()->getLocale())
?? $release?->category?->translations?->first();
$categoryName = $category?->name;
$time = $release?->published_at?->isToday()
? $release->published_at->format('H:i')
: ($release?->published_at?->isYesterday() ? __('web.shared.yesterday') : $release?->published_at?->isoFormat('D. MMM'));
$categoryName = $release?->localizedCategoryName();
$time = $release?->compactPublishedLabel();
$title = $release->title;
$company = $release?->company?->name;
$href = route('release.detail', ['slug' => $release->slug]);
$image = $release?->images?->first();
$imageUrl = $image?->variantUrl('card') ?? $image?->url();
$imageUrl = $release?->cardImageUrl();
$placeholderUrl = $imageUrl ? null : $release?->chosenPlaceholderUrl();
$gradient = 'linear-gradient(135deg,#3A4A5A,#6B7C95)';
$number = str_pad((string) $index, 2, '0', STR_PAD_LEFT);

View file

@ -24,15 +24,12 @@
$leadImage = $leadRelease?->images->first();
$leadImageUrl = $leadImage?->variantUrl('detail') ?? $leadImage?->variantUrl('card') ?? $leadImage?->url();
$leadPlaceholderUrl = $leadImageUrl ? null : $leadRelease?->chosenPlaceholderUrl();
$leadCat = $leadRelease?->category?->translations->firstWhere('locale', app()->getLocale()) ?? $leadRelease?->category?->translations->first();
$leadCatName = $leadRelease?->localizedCategoryName();
$leadCompany = $leadRelease?->company?->name;
$leadLead = $leadRelease
? (filled($leadRelease->subtitle)
? $leadRelease->subtitle
: (string) Str::of(strip_tags((string) $leadRelease->text))->squish()->limit(220))
? (filled($leadRelease->subtitle) ? $leadRelease->subtitle : $leadRelease->teaserText(220))
: null;
$leadWords = $leadRelease ? str_word_count(strip_tags((string) $leadRelease->text)) : 0;
$leadReadTime = max(1, (int) round($leadWords / 200));
$leadReadTime = $leadRelease?->readTimeMinutes() ?? 1;
@endphp
@section('title', __('web.category.meta_title', ['category' => $catName, 'brand' => config('app.name')]))
@ -135,8 +132,8 @@
<span class="bp-tag">{{ __('web.hero.top_story') }}</span>
</div>
<div class="absolute left-0 right-0 bottom-0 px-6 sm:px-9 pb-8 pt-[70px] text-white" style="background:linear-gradient(180deg,transparent,rgba(0,0,0,0.92));">
@if ($leadCat)
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCat->name }}</div>
@if ($leadCatName)
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCatName }}</div>
@endif
<h2 class="font-serif text-[26px] sm:text-[32px] font-semibold m-0 leading-[1.12] tracking-[-0.6px] max-w-[680px] group-hover:text-white">
{{ $leadRelease->title }}

View file

@ -25,14 +25,11 @@
$leadImage = $leadRelease?->images->first();
$leadImageUrl = $leadImage?->variantUrl('detail') ?? $leadImage?->variantUrl('card') ?? $leadImage?->url();
$leadPlaceholderUrl = $leadImageUrl ? null : $leadRelease?->chosenPlaceholderUrl();
$leadCat = $leadRelease?->category?->translations->firstWhere('locale', app()->getLocale()) ?? $leadRelease?->category?->translations->first();
$leadCatName = $leadRelease?->localizedCategoryName();
$leadLead = $leadRelease
? (filled($leadRelease->subtitle)
? $leadRelease->subtitle
: (string) Str::of(strip_tags((string) $leadRelease->text))->squish()->limit(220))
? (filled($leadRelease->subtitle) ? $leadRelease->subtitle : $leadRelease->teaserText(220))
: null;
$leadWords = $leadRelease ? str_word_count(strip_tags((string) $leadRelease->text)) : 0;
$leadReadTime = max(1, (int) round($leadWords / 200));
$leadReadTime = $leadRelease?->readTimeMinutes() ?? 1;
@endphp
@section('title', $company->name.' – Newsroom · '.$brandName.$brandAccent)
@ -164,8 +161,8 @@
<span class="bp-tag">{{ __('web.newsroom_page.latest') }}</span>
</div>
<div class="absolute left-0 right-0 bottom-0 px-6 sm:px-9 pb-8 pt-[70px] text-white" style="background:linear-gradient(180deg,transparent,rgba(0,0,0,0.92));">
@if ($leadCat)
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCat->name }}</div>
@if ($leadCatName)
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCatName }}</div>
@endif
<h2 class="font-serif text-[26px] sm:text-[34px] font-semibold m-0 leading-[1.12] tracking-[-0.6px] max-w-[760px] group-hover:text-white">
{{ $leadRelease->title }}

View file

@ -29,10 +29,10 @@
$embargoAt = $release->embargoAtLocal();
$bodyHtml = $release->renderedText();
$wordCount = str_word_count(strip_tags((string) $release->text));
$readTime = max(1, (int) round($wordCount / 200));
$wordCount = $release->wordCount();
$readTime = $release->readTimeMinutes();
$teaser = (string) Str::of(strip_tags((string) $release->text))->squish()->limit(180);
$teaser = $release->teaserText(180);
// Subline nur bei explizit gesetztem Untertitel — kein Fallback auf den Textanfang,
// sonst erscheint der erste Absatz doppelt. Der Teaser dient nur der Meta-Description.

View file

@ -20,9 +20,7 @@
$exampleCategory = $example?->category?->translations?->first()?->name;
$exampleCompany = $example?->company?->name;
$examplePublishedAt = $example?->published_at;
$exampleReadMinutes = $example
? max(1, (int) ceil(str_word_count(strip_tags((string) $example->text)) / 200))
: 3;
$exampleReadMinutes = $example?->readTimeMinutes() ?? 3;
// Inhalte aus static.publish.* — Reihen als Datenstrukturen (DRY).
$trustPrinciples = [