2022-01-03 13:52:07 +00:00
|
|
|
<?= $this->extend('_layout') ?>
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
|
|
|
<?= lang('Soundbite.list.title') ?>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
<?= $this->section('headerRight') ?>
|
2024-12-17 15:06:08 +00:00
|
|
|
<?php // @icon("add-fill")?>
|
2024-05-09 17:55:41 +00:00
|
|
|
<x-Button uri="<?= route_to('soundbites-create', $podcast->id, $episode->id) ?>" variant="primary" iconLeft="add-fill"><?= lang('Soundbite.create') ?></x-Button>
|
2022-01-03 13:52:07 +00:00
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
|
|
|
<?= data_table(
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'header' => lang('Soundbite.list.soundbite'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'cell' => function ($soundbite): string {
|
2022-03-04 14:33:48 +00:00
|
|
|
return '<div class="flex gap-x-2"><play-soundbite audio-src="' . $soundbite->episode->audio->file_url . '" start-time="' . $soundbite->start_time . '" duration="' . $soundbite->duration . '" play-label="' . lang('Soundbite.play') . '" playing-label="' . lang('Soundbite.stop') . '"></play-soundbite><div class="flex flex-col"><span class="text-sm font-semibold">' . esc($soundbite->title) . '</span><span class="text-xs">' . format_duration((int) $soundbite->duration) . '</span></div></div>';
|
2022-01-03 13:52:07 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'header' => lang('Common.actions'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'cell' => function ($soundbite): string {
|
2024-05-09 17:55:41 +00:00
|
|
|
return '<button id="more-dropdown-' . $soundbite->id . '" type="button" class="inline-flex items-center p-1 rounded-full" data-dropdown="button" data-dropdown-target="more-dropdown-' . $soundbite->id . '-menu" aria-haspopup="true" aria-expanded="false">' .
|
2024-04-26 17:57:25 +00:00
|
|
|
icon('more-2-fill') .
|
2022-01-03 13:52:07 +00:00
|
|
|
'</button>' .
|
2024-05-09 17:55:41 +00:00
|
|
|
'<x-DropdownMenu id="more-dropdown-' . $soundbite->id . '-menu" labelledby="more-dropdown-' . $soundbite->id . '" offsetY="-24" items="' . esc(json_encode([
|
2022-01-03 13:52:07 +00:00
|
|
|
[
|
2023-06-12 14:47:38 +00:00
|
|
|
'type' => 'link',
|
2022-01-03 13:52:07 +00:00
|
|
|
'title' => lang('Soundbite.delete'),
|
2023-06-12 14:47:38 +00:00
|
|
|
'uri' => route_to('soundbites-delete', $soundbite->podcast_id, $soundbite->episode_id, $soundbite->id),
|
2022-01-03 13:52:07 +00:00
|
|
|
'class' => 'font-semibold text-red-600',
|
|
|
|
],
|
|
|
|
])) . '" />';
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
$soundbites,
|
|
|
|
'mb-6',
|
|
|
|
) ?>
|
|
|
|
|
|
|
|
<?= $pager->links() ?>
|
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|