diff --git a/resources/views/components/web/hub/site-footer.blade.php b/resources/views/components/web/hub/site-footer.blade.php index 7ed08aee..ff1c1760 100644 --- a/resources/views/components/web/hub/site-footer.blade.php +++ b/resources/views/components/web/hub/site-footer.blade.php @@ -44,7 +44,7 @@
  • Anmelden
  • Konto erstellen
  • @endauth -
  • Tarife
  • +
  • Tarife
  • @@ -52,8 +52,8 @@
    Plattform
    diff --git a/resources/views/components/web/hub/site-header.blade.php b/resources/views/components/web/hub/site-header.blade.php index 927b11d6..ed677f38 100644 --- a/resources/views/components/web/hub/site-header.blade.php +++ b/resources/views/components/web/hub/site-header.blade.php @@ -14,11 +14,13 @@ ]); $brandTagline = $brand['tagline_short'] ?? 'Publisher · Hub'; + // Absolute Anker auf die Landing, damit die Navigation auch von den + // statischen Unterseiten (Impressum, AGB, API …) aus funktioniert. $navigation = $navigation ?? [ - ['label' => 'Tarife', 'href' => '#tarife'], - ['label' => 'So funktioniert es', 'href' => '#funktion'], - ['label' => 'Plattform-Familie', 'href' => '#familie'], - ['label' => 'FAQ', 'href' => '#faq'], + ['label' => 'Tarife', 'href' => route('home').'#tarife'], + ['label' => 'So funktioniert es', 'href' => route('home').'#funktion'], + ['label' => 'Plattform-Familie', 'href' => route('home').'#familie'], + ['label' => 'FAQ', 'href' => route('home').'#faq'], ]; @endphp diff --git a/resources/views/components/web/static-page.blade.php b/resources/views/components/web/static-page.blade.php index 86138bcf..e4c5c717 100644 --- a/resources/views/components/web/static-page.blade.php +++ b/resources/views/components/web/static-page.blade.php @@ -11,21 +11,34 @@ Liefert site-header, Breadcrumb, Masthead und site-footer; der Seiteninhalt kommt als Slot. Prosa-Seiten wrappen ihren Inhalt in `.pm-body` (zentrale Editorial-Typografie aus shared-styles.css). + + Host-aware: Auf der Hub-Domain (pressekonto) rendert das Hub-Gerüst + (Utility-Bar, Hub-Header/-Footer inkl. Kontakt- und Widerrufs-Modal), + auf den Spokes das Portal-Gerüst. --}} @php - $brandConfig = config('domains.domains.'.config('app.theme').'.brand', []); + $isHub = str_contains(request()->getHost(), 'pressekonto'); + $brandConfig = $isHub + ? config('domains.domains.pressekonto.brand', []) + : config('domains.domains.'.config('app.theme').'.brand', []); $brandName = $brandConfig['name'] ?? 'businessportal'; $brandAccent = $brandConfig['accent'] ?? '24'; + $homeHref = $isHub ? route('home') : route('web.home'); @endphp - +@if ($isHub) + + +@else + +@endif
    {{-- Breadcrumb --}}
    - {{ $brandName }}{{ $brandAccent }} + {{ $brandName }}{{ $brandAccent }} @if ($breadcrumb) {{ $breadcrumb }} @@ -54,4 +67,10 @@
    - +@if ($isHub) + + + +@else + +@endif diff --git a/tests/Feature/Web/HubStaticPageShellTest.php b/tests/Feature/Web/HubStaticPageShellTest.php new file mode 100644 index 00000000..c609ce4d --- /dev/null +++ b/tests/Feature/Web/HubStaticPageShellTest.php @@ -0,0 +1,38 @@ +get('https://pressekonto.test/de/'.$path)->assertSuccessful(); + $content = $response->getContent(); + + expect($content) + // Hub-Kopf: Utility-Bar + Hub-Header statt Spoke-Gerüst. + ->toContain('Publisher-Hub für') + ->toContain('Publisher · Hub') + // Hub-Footer inkl. gesetzlichem Widerrufsbutton + Modals. + ->toContain('Vertrag widerrufen') + ->toContain('open-withdrawal-modal') + ->toContain('open-contact-modal') + // Kein Spoke-Portal-Branding im Gerüst. + ->not->toContain('Pressemitteilungen · DACH'); +})->with(['impressum', 'agb', 'datenschutz', 'cookies', 'api']); + +test('the hub static page breadcrumb links back to the hub landing', function () { + /** @var TestCase $this */ + $this->get('https://pressekonto.test/de/impressum') + ->assertSuccessful() + ->assertSee('href="https://pressekonto.test"', false) + ->assertSeeText('pressekonto'); +}); + +test('static pages on the spoke domains keep the spoke shell', function () { + /** @var TestCase $this */ + $response = $this->get('https://businessportal24.test/de/impressum')->assertSuccessful(); + $content = $response->getContent(); + + expect($content) + ->not->toContain('Publisher-Hub für') + ->not->toContain('Vertrag widerrufen'); +});