2020-10-02 15:38:16 +00:00
|
|
|
<section class="flex flex-col">
|
|
|
|
<header class="flex justify-between py-2">
|
2021-09-10 16:02:25 +00:00
|
|
|
<Heading tagName="h2"><?= lang('Podcast.latest_episodes') ?></Heading>
|
2020-10-02 15:38:16 +00:00
|
|
|
<a href="<?= route_to(
|
2021-09-08 15:51:33 +00:00
|
|
|
'episode-list',
|
|
|
|
$podcast->id,
|
|
|
|
) ?>" class="inline-flex items-center text-sm underline hover:no-underline">
|
2020-10-02 15:38:16 +00:00
|
|
|
<?= lang('Podcast.see_all_episodes') ?>
|
|
|
|
<?= icon('chevron-right', 'ml-2') ?>
|
|
|
|
</a>
|
|
|
|
</header>
|
|
|
|
<?php if ($episodes): ?>
|
2021-09-03 16:34:06 +00:00
|
|
|
<div class="flex p-2 overflow-x-auto gap-x-6 snap snap-x snap-proximity">
|
2020-10-02 15:38:16 +00:00
|
|
|
<?php foreach ($episodes as $episode): ?>
|
2021-09-03 16:34:06 +00:00
|
|
|
<article class="snap-center flex flex-col flex-shrink-0 flex-1 w-full min-w-[12rem] max-w-[17rem] overflow-hidden bg-white border-2 border-pine-100 rounded-xl">
|
2021-08-09 10:28:16 +00:00
|
|
|
<div class="relative">
|
|
|
|
<?= publication_pill(
|
2021-09-08 15:51:33 +00:00
|
|
|
$episode->published_at,
|
|
|
|
$episode->publication_status,
|
|
|
|
'absolute top-2 right-2 text-sm'
|
|
|
|
); ?>
|
2021-08-09 10:28:16 +00:00
|
|
|
<img
|
2021-09-07 15:43:09 +00:00
|
|
|
src="<?= $episode->image->medium_url ?>"
|
2021-08-09 10:28:16 +00:00
|
|
|
alt="<?= $episode->title ?>" class="object-cover w-full" />
|
|
|
|
</div>
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="flex items-start justify-between p-2">
|
|
|
|
<div class="flex flex-col min-w-0">
|
2020-10-02 15:38:16 +00:00
|
|
|
<a href="<?= route_to(
|
2021-09-08 15:51:33 +00:00
|
|
|
'episode-view',
|
|
|
|
$podcast->id,
|
|
|
|
$episode->id,
|
|
|
|
) ?>"
|
2021-04-02 17:20:02 +00:00
|
|
|
class="text-sm font-semibold truncate hover:underline"
|
2021-08-09 10:28:16 +00:00
|
|
|
>
|
|
|
|
<?= episode_numbering(
|
2021-09-08 15:51:33 +00:00
|
|
|
$episode->number,
|
|
|
|
$episode->season_number,
|
|
|
|
'font-semibold text-gray-600',
|
|
|
|
true,
|
|
|
|
) ?>
|
2021-08-09 10:28:16 +00:00
|
|
|
<span class="mx-1">-</span>
|
|
|
|
<?= $episode->title ?>
|
|
|
|
</a>
|
2020-10-02 15:38:16 +00:00
|
|
|
</div>
|
2021-04-02 17:20:02 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="inline-flex items-center p-1 outline-none focus:ring"
|
|
|
|
id="more-dropdown-<?= $episode->id ?>"
|
|
|
|
data-dropdown="button"
|
|
|
|
data-dropdown-target="more-dropdown-<?= $episode->id ?>-menu"
|
|
|
|
aria-label="<?= lang('Common.more') ?>"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false"
|
|
|
|
><?= icon('more') ?></button>
|
2021-09-28 15:47:59 +00:00
|
|
|
<DropdownMenu id="more-dropdown-<?= $episode->id ?>-menu" labeledBy="more-dropdown-<?= $episode->id ?>" items="<?= esc(json_encode([
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Episode.edit'),
|
|
|
|
'uri' => route_to('episode-edit', $podcast->id, $episode->id),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Episode.embeddable_player.title'),
|
|
|
|
'uri' => route_to('embeddable-player-add', $podcast->id, $episode->id),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Person.persons'),
|
|
|
|
'uri' => route_to('episode-persons-manage', $podcast->id, $episode->id),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Episode.soundbites'),
|
|
|
|
'uri' => route_to('soundbites-edit', $podcast->id, $episode->id),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Episode.go_to_page'),
|
|
|
|
'uri' => route_to('episode', $podcast->handle, $episode->slug),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'separator',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'link',
|
|
|
|
'title' => lang('Episode.delete'),
|
|
|
|
'uri' => route_to('episode-delete', $podcast->id, $episode->id),
|
|
|
|
'class' => 'font-semibold text-red-600',
|
|
|
|
],
|
|
|
|
])) ?>" />
|
2020-10-02 15:38:16 +00:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<?php else: ?>
|
|
|
|
<p class="italic"><?= lang('Podcast.no_episode') ?></p>
|
|
|
|
<?php endif; ?>
|
2021-08-09 10:28:16 +00:00
|
|
|
</section>
|