R4.3: Karten-Metadaten-Logik als PressRelease-Praesentations-Helper

localizedCategoryName/cardImageUrl/teaserText/wordCount/readTimeMinutes/
compactPublishedLabel ersetzen die 5x kopierte @php-Logik der
Kartenkomponenten; Lesezeit-Formel vereinheitlicht (ceil -> round in
HomePageData-Spotlight). Tests: Web/PressReleaseCardHelpersTest.

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 56ea3d0169
commit 813cbd2e18
4 changed files with 137 additions and 3 deletions

View file

@ -206,7 +206,6 @@ class HomePageData
->limit(3)
->get()
->map(static function (PressRelease $release) use ($spotlightTranslation): array {
$words = str_word_count(strip_tags((string) $release->text));
$publishedAt = $release->published_at;
return [
@ -216,7 +215,7 @@ class HomePageData
'title' => $release->title,
'company' => $release->company?->name ?? '',
'city' => null,
'minutes' => max(1, (int) ceil($words / 200)),
'minutes' => $release->readTimeMinutes(),
'href' => $release->slug ? route('release.detail', ['slug' => $release->slug]) : '#',
];
});