AzuraCast/templates/frontend/public/podcasts.phtml

93 lines
3.9 KiB
PHTML

<?php
$this->layout('minimal', [
'page_class' => 'podcasts station-' . $station->getShortName(),
'title' => 'Podcasts - ' . $station->getName(),
'hide_footer' => true,
]);
$this->fetch('frontend/public/partials/station-custom', ['station' => $station]);
?>
<div class="public-page">
<section class="card" role="region">
<div class="card-body">
<h1 class="card-title mb-3">
<?= $this->e($station->getName()) ?>
</h1>
<?php
/** @var App\Entity\Podcast $podcast */
foreach ($podcasts as $podcast) : ?>
<?php
$episodesPageLink = (string)$router->named(
'public:podcast:episodes',
[
'station_id' => $station->getId(),
'podcast_id' => $podcast->getId(),
]
) ?>
<?php
$feedLink = (string)$router->named(
'public:podcast:feed',
['station_id' => $station->getId(), 'podcast_id' => $podcast->getId()]
) ?>
<div class="d-flex align-items-center mb-3">
<div class="flex-shrink-0 pe-2" style="max-width: 128px">
<a href="<?= $this->e($episodesPageLink) ?>" title="<?= __('Episodes') ?>">
<img src="<?= $router->named(
'api:stations:podcast:art',
[
'station_id' => $station->getId(),
'podcast_id' => $podcast->getId(),
]
); ?>" class="card-img img-fluid" alt="<?= $this->e($podcast->getTitle()) ?>">
</a>
</div>
<div class="d-fill">
<h5 class="card-subtitle"><?= $this->e($podcast->getTitle()) ?></h5>
<p class="card-text"><?= $this->e($podcast->getDescription()) ?></p>
<p class="card-text">
<small class="text-muted"><?= __('Language') ?>: <?= strtoupper(
$podcast->getLanguage()
) ?></small>
<br/>
<small class="text-muted"><?= __('Categories') ?>: <?= implode(
$podcast->getCategories()->map(
function ($category) {
$title = $category->getTitle();
$subtitle = $category->getSubTitle();
return (!empty($subtitle))
? $title . ' - ' . $subtitle
: $title;
}
)->getValues()
); ?></small>
</p>
<div class="buttons">
<a href="<?= $episodesPageLink ?>" class="btn btn-sm btn-primary">
<?= __('Episodes') ?>
</a>
<a href="<?= $feedLink ?>" class="btn btn-sm btn-warning"
target="_blank">
<?= $this->fetch('icons/rss') ?>
<span><?= __('RSS Feed') ?></span>
</a>
</div>
</div>
</div>
<?php
endforeach; ?>
<?php
if (count($podcasts) === 0) : ?>
<p class="card-text"><?= __('No entries found.') ?></p>
<?php
endif; ?>
</div>
</section>
</div>