From 88e455f57ae9c43d720de94e607891302bc12ef6 Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Mon, 30 Jan 2023 09:11:57 -0600 Subject: [PATCH] Fixes #6051 -- Apply per-station branding to embed pages too. --- src/Controller/Frontend/PublicPages/HistoryAction.php | 10 +++++++++- src/Controller/Frontend/PublicPages/OnDemandAction.php | 10 +++++++++- src/Controller/Frontend/PublicPages/PlayerAction.php | 10 +++++++++- src/Controller/Frontend/PublicPages/ScheduleAction.php | 10 +++++++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/Controller/Frontend/PublicPages/HistoryAction.php b/src/Controller/Frontend/PublicPages/HistoryAction.php index f11c85f08..379dd0201 100644 --- a/src/Controller/Frontend/PublicPages/HistoryAction.php +++ b/src/Controller/Frontend/PublicPages/HistoryAction.php @@ -28,7 +28,15 @@ final class HistoryAction throw new StationNotFoundException(); } - return $request->getView()->renderVuePage( + $view = $request->getView(); + + // Add station public code. + $view->fetch( + 'frontend/public/partials/station-custom', + ['station' => $station] + ); + + return $view->renderVuePage( response: $response->withHeader('X-Frame-Options', '*'), component: 'Vue_PublicHistory', id: 'song-history', diff --git a/src/Controller/Frontend/PublicPages/OnDemandAction.php b/src/Controller/Frontend/PublicPages/OnDemandAction.php index a882a2461..96747f06e 100644 --- a/src/Controller/Frontend/PublicPages/OnDemandAction.php +++ b/src/Controller/Frontend/PublicPages/OnDemandAction.php @@ -58,7 +58,15 @@ final class OnDemandAction $pageClass .= ' embed'; } - return $request->getView()->renderVuePage( + $view = $request->getView(); + + // Add station public code. + $view->fetch( + 'frontend/public/partials/station-custom', + ['station' => $station] + ); + + return $view->renderVuePage( response: $response->withHeader('X-Frame-Options', '*'), component: 'Vue_PublicOnDemand', id: 'station-on-demand', diff --git a/src/Controller/Frontend/PublicPages/PlayerAction.php b/src/Controller/Frontend/PublicPages/PlayerAction.php index d5c292ac6..9d441960c 100644 --- a/src/Controller/Frontend/PublicPages/PlayerAction.php +++ b/src/Controller/Frontend/PublicPages/PlayerAction.php @@ -46,7 +46,15 @@ final class PlayerAction $pageClasses[] = 'page-station-public-player-embed station-' . $station->getShortName(); $pageClasses[] = ('social' === $embed) ? 'embed-social' : 'embed'; - return $request->getView()->renderVuePage( + $view = $request->getView(); + + // Add station public code. + $view->fetch( + 'frontend/public/partials/station-custom', + ['station' => $station] + ); + + return $view->renderVuePage( response: $response, component: 'Vue_PublicPlayer', id: 'station-nowplaying', diff --git a/src/Controller/Frontend/PublicPages/ScheduleAction.php b/src/Controller/Frontend/PublicPages/ScheduleAction.php index 1d36c6c14..514d06959 100644 --- a/src/Controller/Frontend/PublicPages/ScheduleAction.php +++ b/src/Controller/Frontend/PublicPages/ScheduleAction.php @@ -30,7 +30,15 @@ final class ScheduleAction $pageClass .= ' embed'; } - return $request->getView()->renderVuePage( + $view = $request->getView(); + + // Add station public code. + $view->fetch( + 'frontend/public/partials/station-custom', + ['station' => $station] + ); + + return $view->renderVuePage( response: $response ->withHeader('X-Frame-Options', '*'), component: 'Vue_PublicSchedule',