Loading app/Helpers/components_helper.php +17 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ declare(strict_types=1); * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @link https://castopod.org/ */ use App\Entities\Category; use App\Entities\Location; use CodeIgniter\I18n\Time; use CodeIgniter\View\Table; Loading Loading @@ -331,3 +333,18 @@ if (! function_exists('explicit_badge')) { } // ------------------------------------------------------------------------ if (! function_exists('category_label')) { function category_label(Category $category): string { $categoryLabel = ''; if ($category->parent_id !== null) { $categoryLabel .= lang('Podcast.category_options.' . $category->parent->code) . ' › '; } return $categoryLabel . lang('Podcast.category_options.' . $category->code); } } // ------------------------------------------------------------------------ app/Helpers/seo_helper.php +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ if (! function_exists('get_podcast_metatags')) { { $category = ''; if ($podcast->category->parent_id !== null) { $category .= $podcast->category->parent->apple_category . ' > '; $category .= $podcast->category->parent->apple_category . ' › '; } $category .= $podcast->category->apple_category; Loading app/Libraries/PodcastActor.php +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class PodcastActor extends ActorObject $category = ''; if ($podcast->category->parent_id !== null) { $category .= $podcast->category->parent->apple_category . ' > '; $category .= $podcast->category->parent->apple_category . ' › '; } $category .= $podcast->category->apple_category; Loading themes/cp_app/podcast/about.php +2 −6 Original line number Diff line number Diff line Loading @@ -6,15 +6,11 @@ <div class="mb-2"><?= $podcast->description_html ?></div> <div class="flex gap-x-4 gap-y-2"> <span class="px-2 py-1 text-sm font-semibold border rounded-sm border-subtle bg-highlight"> <?= lang( 'Podcast.category_options.' . $podcast->category->code, ) ?> <?= category_label($podcast->category) ?> </span> <?php foreach ($podcast->other_categories as $other_category): ?> <span class="px-2 py-1 text-sm font-semibold border rounded-sm border-subtle bg-highlight"> <?= lang( 'Podcast.category_options.' . $other_category->code, ) ?> <?= category_label($other_category) ?> </span> <?php endforeach; ?> </div> Loading Loading
app/Helpers/components_helper.php +17 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ declare(strict_types=1); * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @link https://castopod.org/ */ use App\Entities\Category; use App\Entities\Location; use CodeIgniter\I18n\Time; use CodeIgniter\View\Table; Loading Loading @@ -331,3 +333,18 @@ if (! function_exists('explicit_badge')) { } // ------------------------------------------------------------------------ if (! function_exists('category_label')) { function category_label(Category $category): string { $categoryLabel = ''; if ($category->parent_id !== null) { $categoryLabel .= lang('Podcast.category_options.' . $category->parent->code) . ' › '; } return $categoryLabel . lang('Podcast.category_options.' . $category->code); } } // ------------------------------------------------------------------------
app/Helpers/seo_helper.php +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ if (! function_exists('get_podcast_metatags')) { { $category = ''; if ($podcast->category->parent_id !== null) { $category .= $podcast->category->parent->apple_category . ' > '; $category .= $podcast->category->parent->apple_category . ' › '; } $category .= $podcast->category->apple_category; Loading
app/Libraries/PodcastActor.php +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class PodcastActor extends ActorObject $category = ''; if ($podcast->category->parent_id !== null) { $category .= $podcast->category->parent->apple_category . ' > '; $category .= $podcast->category->parent->apple_category . ' › '; } $category .= $podcast->category->apple_category; Loading
themes/cp_app/podcast/about.php +2 −6 Original line number Diff line number Diff line Loading @@ -6,15 +6,11 @@ <div class="mb-2"><?= $podcast->description_html ?></div> <div class="flex gap-x-4 gap-y-2"> <span class="px-2 py-1 text-sm font-semibold border rounded-sm border-subtle bg-highlight"> <?= lang( 'Podcast.category_options.' . $podcast->category->code, ) ?> <?= category_label($podcast->category) ?> </span> <?php foreach ($podcast->other_categories as $other_category): ?> <span class="px-2 py-1 text-sm font-semibold border rounded-sm border-subtle bg-highlight"> <?= lang( 'Podcast.category_options.' . $other_category->code, ) ?> <?= category_label($other_category) ?> </span> <?php endforeach; ?> </div> Loading