diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 74d1a06a..04b8ebfd 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -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', diff --git a/app/Controllers/PodcastController.php b/app/Controllers/PodcastController.php index 47892deb..21ce0ed0 100644 --- a/app/Controllers/PodcastController.php +++ b/app/Controllers/PodcastController.php @@ -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 diff --git a/app/Helpers/page_helper.php b/app/Helpers/page_helper.php index 002e6ae0..7a24aaa1 100644 --- a/app/Helpers/page_helper.php +++ b/app/Helpers/page_helper.php @@ -23,10 +23,10 @@ if (! function_exists('render_page_links')) { 'class' => 'px-2 py-1 underline hover:no-underline', ]); $links .= anchor(route_to('credits'), lang('Person.credits'), [ - 'class' => 'px-2 py-1 underline hover:no-underline', + '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, [ diff --git a/app/Language/en/Podcast.php b/app/Language/en/Podcast.php index 0683cb2d..0c311ed8 100644 --- a/app/Language/en/Podcast.php +++ b/app/Language/en/Podcast.php @@ -42,6 +42,7 @@ return [ }', 'activity' => 'Activity', 'episodes' => 'Episodes', + 'about' => 'About', 'sponsor_title' => 'Enjoying the show?', 'sponsor' => 'Sponsor', 'funding_links' => 'Funding links for {podcastTitle}', diff --git a/app/Language/fr/Podcast.php b/app/Language/fr/Podcast.php index 12e9bba3..d332a933 100644 --- a/app/Language/fr/Podcast.php +++ b/app/Language/fr/Podcast.php @@ -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}', diff --git a/tailwind.config.js b/tailwind.config.js index cfe1014c..ea55a83c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,5 +1,6 @@ /* eslint-disable */ const defaultTheme = require("tailwindcss/defaultTheme"); +const colors = require("tailwindcss/colors"); module.exports = { mode: "jit", @@ -42,6 +43,7 @@ module.exports = { 800: "#b21a39", 900: "#8e162e", }, + orange: colors.orange, }, spacing: { 112: "28rem", diff --git a/themes/cp_app/_admin_navbar.php b/themes/cp_app/_admin_navbar.php new file mode 100644 index 00000000..aedbab7b --- /dev/null +++ b/themes/cp_app/_admin_navbar.php @@ -0,0 +1,46 @@ +