PM-Detailseite: Direktlinks zur öffentlichen Seite je Portal

Veröffentlichte PMs zeigten im Backend nur den Status-Badge, ohne Weg
zur öffentlichen Seite. Im Seitenkopf stehen jetzt Direktlinks — bei
Portal::Both einer je Portal (QA-Befund 07.07.).

Die URL-Logik ist als PressRelease::publicPortalLinks() zentralisiert
(vorher doppelt in der Published-Mail und fehlerhaft im Nachweis-PDF:
dort fehlte das /de/press-release/-Segment, die dokumentierte URL lief
ins Leere; bei Both nennt der Nachweis jetzt beide URLs). Edition folgt
der PM-Sprache statt hart „de".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-07 15:00:40 +00:00
parent 930760a056
commit 28de92e18b
6 changed files with 128 additions and 13 deletions

View file

@ -90,25 +90,21 @@ class ProofPdfRenderer
*/
private function metaRows(PressRelease $pressRelease, string $portalLabel, string $dateLabel): array
{
// Bei Portal::Both dokumentiert der Nachweis beide öffentlichen URLs.
$links = $pressRelease->publicPortalLinks();
$urlRows = array_map(static fn (array $link): array => [
count($links) > 1 ? 'URL '.$link['label'] : 'URL',
$link['url'],
], $links);
return array_values(array_filter([
['Portal', $portalLabel],
['Veröffentlicht', $dateLabel],
['URL', $this->publicUrl($pressRelease)],
...$urlRows,
$pressRelease->category?->name ? ['Kategorie', (string) $pressRelease->category->name] : null,
]));
}
private function publicUrl(PressRelease $pressRelease): string
{
$base = match ($pressRelease->portal) {
Portal::Presseecho => config('domains.domain_presseecho_url'),
Portal::Businessportal24 => config('domains.domain_businessportal_url'),
default => config('app.url'),
};
return rtrim((string) $base, '/').'/'.ltrim((string) $pressRelease->slug, '/');
}
private function previewText(PressRelease $pressRelease): string
{
$plain = trim(html_entity_decode(strip_tags((string) $pressRelease->text)));