2022-09-28 17:02:09 +02:00
|
|
|
<article class="relative flex flex-col flex-1 flex-shrink-0 w-full transition group overflow-hidden bg-elevated border-3 snap-center hover:shadow-lg focus-within:shadow-lg focus-within:ring-accent rounded-xl min-w-[12rem] max-w-[17rem] <?= $episode->is_premium ? 'border-accent-base' : 'border-subtle' ?>">
|
2021-10-21 15:12:38 +02:00
|
|
|
<a href="<?= route_to('episode-view', $episode->podcast->id, $episode->id) ?>" class="flex flex-col justify-end w-full h-full text-white group">
|
2022-01-20 15:51:31 +01:00
|
|
|
<div class="absolute bottom-0 left-0 z-10 w-full h-full backdrop-gradient mix-blend-multiply"></div>
|
2022-01-21 19:07:43 +01:00
|
|
|
<div class="w-full h-full overflow-hidden bg-header">
|
2022-03-04 15:33:48 +01:00
|
|
|
<img src="<?= $episode->cover->medium_url ?>" alt="<?= esc($episode->title) ?>" class="object-cover w-full h-full transition duration-200 ease-in-out transform group-focus:scale-105 group-hover:scale-105 aspect-square" loading="lazy" />
|
2021-10-21 15:12:38 +02:00
|
|
|
</div>
|
2022-09-28 17:02:09 +02:00
|
|
|
<?php if ($episode->is_premium): ?>
|
|
|
|
<div class="absolute top-0 left-0 inline-flex mt-2 gap-x-2">
|
|
|
|
<Icon glyph="exchange-dollar" class="w-8 pl-2 text-2xl rounded-r-full rounded-tl-lg text-accent-contrast bg-accent-base" />
|
|
|
|
<?= publication_pill($episode->published_at, $episode->publication_status, 'text-sm'); ?>
|
|
|
|
</div>
|
|
|
|
<?php else: ?>
|
|
|
|
<?= publication_pill($episode->published_at, $episode->publication_status, 'absolute top-0 left-0 ml-2 mt-2 text-sm'); ?>
|
|
|
|
<?php endif; ?>
|
2021-10-21 15:12:38 +02:00
|
|
|
<div class="absolute z-20 flex flex-col items-start px-4 py-2">
|
2021-12-07 14:46:08 +01:00
|
|
|
<?= episode_numbering($episode->number, $episode->season_number, 'text-xs font-semibold !no-underline px-1 bg-black/50 mr-1', true) ?>
|
2022-03-04 15:33:48 +01:00
|
|
|
<span class="font-semibold leading-tight line-clamp-2"><?= esc($episode->title) ?></span>
|
2021-10-21 15:12:38 +02:00
|
|
|
</div>
|
|
|
|
</a>
|
2021-11-05 15:36:34 +01:00
|
|
|
<button class="absolute top-0 right-0 z-10 p-2 mt-2 mr-2 text-white transition -translate-y-12 rounded-full opacity-0 focus:ring-accent focus:opacity-100 focus:-translate-y-0 group-hover:translate-y-0 bg-black/50 group-hover:opacity-100" id="more-dropdown-<?= $episode->id ?>" data-dropdown="button" data-dropdown-target="more-dropdown-<?= $episode->id ?>-menu" aria-haspopup="true" aria-expanded="false" title="<?= lang('Common.more') ?>"><?= icon('more') ?></button>
|
2022-05-05 17:48:16 +02:00
|
|
|
<?php $items = [
|
2021-10-21 15:12:38 +02:00
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2021-10-21 15:12:38 +02:00
|
|
|
'title' => lang('Episode.go_to_page'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('episode', esc($episode->podcast->handle), esc($episode->slug)),
|
2021-10-21 15:12:38 +02:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2021-10-21 15:12:38 +02:00
|
|
|
'title' => lang('Episode.edit'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('episode-edit', $episode->podcast->id, $episode->id),
|
2021-10-21 15:12:38 +02:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2021-10-21 15:12:38 +02:00
|
|
|
'title' => lang('Episode.embed.title'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('embed-add', $episode->podcast->id, $episode->id),
|
2021-10-21 15:12:38 +02:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2021-10-21 15:12:38 +02:00
|
|
|
'title' => lang('Person.persons'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('episode-persons-manage', $episode->podcast->id, $episode->id),
|
2021-10-21 15:12:38 +02:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2022-01-05 15:58:53 +01:00
|
|
|
'title' => lang('VideoClip.list.title'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('video-clips-list', $episode->podcast->id, $episode->id),
|
2022-01-05 15:58:53 +01:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2022-01-05 15:58:53 +01:00
|
|
|
'title' => lang('Soundbite.list.title'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('soundbites-list', $episode->podcast->id, $episode->id),
|
2021-10-21 15:12:38 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'separator',
|
|
|
|
],
|
2022-05-05 17:48:16 +02:00
|
|
|
];
|
2023-02-22 17:29:45 +01:00
|
|
|
if ($episode->published_at === null) {
|
|
|
|
$items[] = [
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2023-02-22 17:29:45 +01:00
|
|
|
'title' => lang('Episode.delete'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('episode-delete', $episode->podcast->id, $episode->id),
|
2023-02-22 17:29:45 +01:00
|
|
|
'class' => 'font-semibold text-red-600',
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
$label = lang('Episode.delete');
|
|
|
|
$icon = icon('forbid', 'mr-2');
|
|
|
|
$title = lang('Episode.messages.unpublishBeforeDeleteTip');
|
|
|
|
$items[] = [
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'html',
|
2023-08-26 15:03:01 +02:00
|
|
|
'content' => esc(<<<HTML
|
2022-05-05 17:48:16 +02:00
|
|
|
<span class="inline-flex items-center px-4 py-1 font-semibold text-gray-400 cursor-not-allowed" data-tooltip="bottom" title="{$title}">{$icon}{$label}</span>
|
2023-08-26 15:03:01 +02:00
|
|
|
HTML),
|
2023-02-22 17:29:45 +01:00
|
|
|
];
|
|
|
|
} ?>
|
2022-05-05 17:48:16 +02:00
|
|
|
<DropdownMenu id="more-dropdown-<?= $episode->id ?>-menu" labelledby="more-dropdown-<?= $episode->id ?>" offsetY="-32" items="<?= esc(json_encode($items)) ?>" />
|
2021-10-21 15:12:38 +02:00
|
|
|
</article>
|