Loading app/Config/Routes.php +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ $routes->group('@(:podcastHandle)', function ($routes): void { ], ], ]); $routes->get('about', 'PodcastController::about/$1', [ 'as' => 'podcast-about', ]); $routes->options('episodes', 'ActivityPubController::preflight'); $routes->get('episodes', 'PodcastController::episodes/$1', [ 'as' => 'podcast-episodes', Loading app/Controllers/PodcastController.php +45 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,51 @@ class PodcastController extends BaseController return $cachedView; } public function about(): string { // Prevent analytics hit when authenticated if (! can_user_interact()) { $this->registerPodcastWebpageHit($this->podcast->id); } $cacheName = implode( '_', array_filter([ 'page', "podcast#{$this->podcast->id}", 'about', service('request') ->getLocale(), can_user_interact() ? '_authenticated' : null, ]), ); if (! ($cachedView = cache($cacheName))) { $data = [ 'podcast' => $this->podcast, ]; // if user is logged in then send to the authenticated activity view if (can_user_interact()) { helper('form'); return view('podcast/about_authenticated', $data); } $secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode( $this->podcast->id, ); return view('podcast/about', $data, [ 'cache' => $secondsToNextUnpublishedEpisode ? $secondsToNextUnpublishedEpisode : DECADE, 'cache_name' => $cacheName, ]); } return $cachedView; } public function episodes(): string { // Prevent analytics hit when authenticated Loading app/Helpers/page_helper.php +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ if (! function_exists('render_page_links')) { 'class' => 'px-2 py-1 underline hover:no-underline', ]); $links .= anchor(route_to('map'), lang('Page.map'), [ 'class' => 'px-2 underline hover:no-underline', 'class' => 'px-2 py-1 underline hover:no-underline', ]); foreach ($pages as $page) { $links .= anchor($page->link, $page->title, [ Loading app/Language/en/Podcast.php +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ return [ }', 'activity' => 'Activity', 'episodes' => 'Episodes', 'about' => 'About', 'sponsor_title' => 'Enjoying the show?', 'sponsor' => 'Sponsor', 'funding_links' => 'Funding links for {podcastTitle}', Loading app/Language/fr/Podcast.php +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ return [ }', 'activity' => 'Activité', 'episodes' => 'Épisodes', 'about' => 'About', 'sponsor_title' => 'Vous aimez le podcast ?', 'sponsor' => 'Soutenez-nous', 'funding_links' => 'Liens de financement pour {podcastTitle}', Loading Loading
app/Config/Routes.php +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ $routes->group('@(:podcastHandle)', function ($routes): void { ], ], ]); $routes->get('about', 'PodcastController::about/$1', [ 'as' => 'podcast-about', ]); $routes->options('episodes', 'ActivityPubController::preflight'); $routes->get('episodes', 'PodcastController::episodes/$1', [ 'as' => 'podcast-episodes', Loading
app/Controllers/PodcastController.php +45 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,51 @@ class PodcastController extends BaseController return $cachedView; } public function about(): string { // Prevent analytics hit when authenticated if (! can_user_interact()) { $this->registerPodcastWebpageHit($this->podcast->id); } $cacheName = implode( '_', array_filter([ 'page', "podcast#{$this->podcast->id}", 'about', service('request') ->getLocale(), can_user_interact() ? '_authenticated' : null, ]), ); if (! ($cachedView = cache($cacheName))) { $data = [ 'podcast' => $this->podcast, ]; // if user is logged in then send to the authenticated activity view if (can_user_interact()) { helper('form'); return view('podcast/about_authenticated', $data); } $secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode( $this->podcast->id, ); return view('podcast/about', $data, [ 'cache' => $secondsToNextUnpublishedEpisode ? $secondsToNextUnpublishedEpisode : DECADE, 'cache_name' => $cacheName, ]); } return $cachedView; } public function episodes(): string { // Prevent analytics hit when authenticated Loading
app/Helpers/page_helper.php +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ if (! function_exists('render_page_links')) { 'class' => 'px-2 py-1 underline hover:no-underline', ]); $links .= anchor(route_to('map'), lang('Page.map'), [ 'class' => 'px-2 underline hover:no-underline', 'class' => 'px-2 py-1 underline hover:no-underline', ]); foreach ($pages as $page) { $links .= anchor($page->link, $page->title, [ Loading
app/Language/en/Podcast.php +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ return [ }', 'activity' => 'Activity', 'episodes' => 'Episodes', 'about' => 'About', 'sponsor_title' => 'Enjoying the show?', 'sponsor' => 'Sponsor', 'funding_links' => 'Funding links for {podcastTitle}', Loading
app/Language/fr/Podcast.php +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ return [ }', 'activity' => 'Activité', 'episodes' => 'Épisodes', 'about' => 'About', 'sponsor_title' => 'Vous aimez le podcast ?', 'sponsor' => 'Soutenez-nous', 'funding_links' => 'Liens de financement pour {podcastTitle}', Loading