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:
parent
56ea3d0169
commit
813cbd2e18
4 changed files with 137 additions and 3 deletions
|
|
@ -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]) : '#',
|
||||
];
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue