2021-09-02 16:34:25 +00:00
|
|
|
|
<?= $this->extend('_layout') ?>
|
2021-02-10 16:20:01 +00:00
|
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
<?= lang('Person.episode_form.title') ?> (<?= count($episode->persons) ?>)
|
2021-02-10 16:20:01 +00:00
|
|
|
|
<?= $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 variant="primary" uri="<?= route_to('person-create') ?>" iconLeft="add-fill"><?= lang('Person.create') ?></x-Button>
|
2021-02-10 16:20:01 +00:00
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
|
2022-01-02 14:11:05 +00:00
|
|
|
|
<form action="<?= route_to('episode-persons-manage', $podcast->id, $episode->id) ?>" method="POST" class="max-w-xl">
|
2021-10-18 16:44:07 +00:00
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
|
<x-Forms.Section
|
2021-10-18 16:44:07 +00:00
|
|
|
|
title="<?= lang('Person.episode_form.add_section_title') ?>"
|
|
|
|
|
subtitle="<?= lang('Person.episode_form.add_section_subtitle') ?>"
|
|
|
|
|
>
|
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
|
<x-Forms.Field
|
2024-05-12 18:38:33 +00:00
|
|
|
|
as="SelectMulti"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
id="persons"
|
2024-10-16 10:57:08 +00:00
|
|
|
|
name="persons"
|
2024-01-24 16:48:23 +00:00
|
|
|
|
label="<?= esc(lang('Person.episode_form.persons')) ?>"
|
|
|
|
|
hint="<?= esc(lang('Person.episode_form.persons_hint')) ?>"
|
2022-01-05 14:58:53 +00:00
|
|
|
|
options="<?= esc(json_encode($personOptions)) ?>"
|
2024-12-19 12:33:57 +00:00
|
|
|
|
defaultValue="<?= implode(',', (old('persons', []))) ?>"
|
2024-05-09 17:55:41 +00:00
|
|
|
|
isRequired="true"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
/>
|
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
|
<x-Forms.Field
|
2024-05-12 18:38:33 +00:00
|
|
|
|
as="SelectMulti"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
id="roles"
|
2024-10-16 10:57:08 +00:00
|
|
|
|
name="roles"
|
2024-01-24 16:48:23 +00:00
|
|
|
|
label="<?= esc(lang('Person.episode_form.roles')) ?>"
|
|
|
|
|
hint="<?= esc(lang('Person.episode_form.roles_hint')) ?>"
|
2022-01-05 14:58:53 +00:00
|
|
|
|
options="<?= esc(json_encode($taxonomyOptions)) ?>"
|
2024-12-19 12:33:57 +00:00
|
|
|
|
defaultValue="<?= implode(',', (old('roles', []))) ?>"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
/>
|
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
|
<x-Button variant="primary" type="submit" class="self-end"><?= lang('Person.episode_form.submit_add') ?></x-Button>
|
2021-10-18 16:44:07 +00:00
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
|
</x-Forms.Section>
|
2021-10-18 16:44:07 +00:00
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
2021-02-10 16:20:01 +00:00
|
|
|
|
<?= data_table(
|
|
|
|
|
[
|
|
|
|
|
[
|
2021-09-15 15:58:21 +00:00
|
|
|
|
'header' => lang('Person.episode_form.persons'),
|
2023-06-12 14:47:38 +00:00
|
|
|
|
'cell' => function ($person) {
|
2021-02-10 16:20:01 +00:00
|
|
|
|
return '<div class="flex">' .
|
|
|
|
|
'<a href="' .
|
2021-05-17 17:11:23 +00:00
|
|
|
|
route_to('person-view', $person->id) .
|
2023-04-13 11:45:03 +00:00
|
|
|
|
'"><img src="' . get_avatar_url($person, 'thumbnail') . '" alt="' . esc($person->full_name) . '" class="object-cover w-16 rounded-full aspect-square" loading="lazy" /></a>' .
|
2021-02-10 16:20:01 +00:00
|
|
|
|
'<div class="flex flex-col ml-3">' .
|
2022-03-04 14:33:48 +00:00
|
|
|
|
esc($person->full_name) .
|
2021-05-17 17:11:23 +00:00
|
|
|
|
implode(
|
|
|
|
|
'',
|
|
|
|
|
array_map(function ($role) {
|
2021-11-05 14:36:34 +00:00
|
|
|
|
return '<span class="text-sm text-skin-muted">' .
|
2021-05-17 17:11:23 +00:00
|
|
|
|
lang(
|
|
|
|
|
"PersonsTaxonomy.persons.{$role->group}.label",
|
|
|
|
|
) .
|
|
|
|
|
' › ' .
|
|
|
|
|
lang(
|
|
|
|
|
"PersonsTaxonomy.persons.{$role->group}.roles.{$role->role}.label",
|
|
|
|
|
) .
|
|
|
|
|
'</span>';
|
|
|
|
|
}, $person->roles),
|
|
|
|
|
) .
|
|
|
|
|
($person->information_url === null
|
2021-02-10 16:20:01 +00:00
|
|
|
|
? ''
|
2022-03-04 14:33:48 +00:00
|
|
|
|
: '<a href="' . esc($person->information_url) . '" target="_blank" rel="noreferrer noopener" class="text-sm font-semibold text-accent-base hover:text-accent-hover">' .
|
|
|
|
|
esc($person->information_url) .
|
2021-08-19 14:00:14 +00:00
|
|
|
|
'</a>') .
|
2021-02-10 16:20:01 +00:00
|
|
|
|
'</div></div>';
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'header' => lang('Common.actions'),
|
2023-06-12 14:47:38 +00:00
|
|
|
|
'cell' => function ($person): string {
|
2024-12-17 15:06:08 +00:00
|
|
|
|
// @icon("delete-bin-fill")
|
2024-05-09 17:55:41 +00:00
|
|
|
|
return '<x-Button uri="' . route_to('episode-person-remove', $person->podcast_id, $person->episode_id, $person->id) . '" variant="danger" size="small" iconLeft="delete-bin-fill">' . lang('Person.episode_form.remove') . '</x-Button>';
|
2021-02-10 16:20:01 +00:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
2021-05-17 17:11:23 +00:00
|
|
|
|
$episode->persons,
|
2025-03-01 13:08:00 +00:00
|
|
|
|
'max-w-xl mt-6',
|
2021-02-10 16:20:01 +00:00
|
|
|
|
) ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|