2022-09-28 15:02:09 +00: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 13:12:38 +00: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 14:51:31 +00:00
|
|
|
<div class="absolute bottom-0 left-0 z-10 w-full h-full backdrop-gradient mix-blend-multiply"></div>
|
2022-01-21 18:07:43 +00:00
|
|
|
<div class="w-full h-full overflow-hidden bg-header">
|
2022-03-04 14:33:48 +00: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 13:12:38 +00:00
|
|
|
</div>
|
2022-09-28 15:02:09 +00:00
|
|
|
<?php if ($episode->is_premium): ?>
|
|
|
|
<div class="absolute top-0 left-0 inline-flex mt-2 gap-x-2">
|
2024-04-26 17:57:25 +00:00
|
|
|
<?= icon('exchange-dollar-fill', [
|
|
|
|
'class' => 'w-8 pl-2 text-2xl rounded-r-full rounded-tl-lg text-accent-contrast bg-accent-base',
|
|
|
|
]) ?>
|
2022-09-28 15:02:09 +00:00
|
|
|
<?= 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 13:12:38 +00:00
|
|
|
<div class="absolute z-20 flex flex-col items-start px-4 py-2">
|
2021-12-07 13:46:08 +00: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 14:33:48 +00:00
|
|
|
<span class="font-semibold leading-tight line-clamp-2"><?= esc($episode->title) ?></span>
|
2021-10-21 13:12:38 +00:00
|
|
|
</div>
|
|
|
|
</a>
|
2024-05-09 17:55:41 +00: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: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-2-fill') ?></button>
|
2022-05-05 15:48:16 +00:00
|
|
|
<?php $items = [
|
2021-10-21 13:12:38 +00:00
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2021-10-21 13:12:38 +00:00
|
|
|
'title' => lang('Episode.go_to_page'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('episode', esc($episode->podcast->handle), esc($episode->slug)),
|
2021-10-21 13:12:38 +00:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2021-10-21 13:12:38 +00:00
|
|
|
'title' => lang('Episode.edit'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('episode-edit', $episode->podcast->id, $episode->id),
|
2021-10-21 13:12:38 +00:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2021-10-21 13:12:38 +00:00
|
|
|
'title' => lang('Episode.embed.title'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('embed-add', $episode->podcast->id, $episode->id),
|
2021-10-21 13:12:38 +00:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2021-10-21 13:12:38 +00:00
|
|
|
'title' => lang('Person.persons'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('episode-persons-manage', $episode->podcast->id, $episode->id),
|
2021-10-21 13:12:38 +00:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2022-01-05 14:58:53 +00:00
|
|
|
'title' => lang('VideoClip.list.title'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('video-clips-list', $episode->podcast->id, $episode->id),
|
2022-01-05 14:58:53 +00:00
|
|
|
],
|
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2022-01-05 14:58:53 +00:00
|
|
|
'title' => lang('Soundbite.list.title'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('soundbites-list', $episode->podcast->id, $episode->id),
|
2021-10-21 13:12:38 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'separator',
|
|
|
|
],
|
2022-05-05 15:48:16 +00:00
|
|
|
];
|
2023-02-22 16:29:45 +00:00
|
|
|
if ($episode->published_at === null) {
|
|
|
|
$items[] = [
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2023-02-22 16:29:45 +00:00
|
|
|
'title' => lang('Episode.delete'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('episode-delete', $episode->podcast->id, $episode->id),
|
2023-02-22 16:29:45 +00:00
|
|
|
'class' => 'font-semibold text-red-600',
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
$label = lang('Episode.delete');
|
2024-04-26 17:57:25 +00:00
|
|
|
$icon = icon('forbid-fill', [
|
|
|
|
'class' => 'mr-2',
|
|
|
|
]);
|
2023-02-22 16:29:45 +00:00
|
|
|
$title = lang('Episode.messages.unpublishBeforeDeleteTip');
|
|
|
|
$items[] = [
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'html',
|
2023-08-26 13:03:01 +00:00
|
|
|
'content' => esc(<<<HTML
|
2022-05-05 15:48:16 +00: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 13:03:01 +00:00
|
|
|
HTML),
|
2023-02-22 16:29:45 +00:00
|
|
|
];
|
|
|
|
} ?>
|
2024-05-09 17:55:41 +00:00
|
|
|
<x-DropdownMenu id="more-dropdown-<?= $episode->id ?>-menu" labelledby="more-dropdown-<?= $episode->id ?>" offsetY="-32" items="<?= esc(json_encode($items)) ?>" />
|
2021-10-21 13:12:38 +00:00
|
|
|
</article>
|