2021-09-02 16:34:25 +00:00
|
|
|
|
<?= $this->extend('_layout') ?>
|
2021-02-10 16:20:01 +00:00
|
|
|
|
|
|
|
|
|
<?= $this->section('title') ?>
|
|
|
|
|
<?= lang('Person.episode_form.title') ?>
|
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $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') ?>
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<Button variant="primary" uri="<?= route_to('person-create') ?>" iconLeft="add"><?= lang('Person.create') ?></Button>
|
2021-02-10 16:20:01 +00:00
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
|
2021-10-18 16:44:07 +00:00
|
|
|
|
<form action="<?= route_to('episode-persons-manage', $podcast->id, $episode->id) ?>" method="POST">
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
|
|
|
|
<Forms.Section
|
|
|
|
|
title="<?= lang('Person.episode_form.add_section_title') ?>"
|
|
|
|
|
subtitle="<?= lang('Person.episode_form.add_section_subtitle') ?>"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<Forms.Field
|
|
|
|
|
as="MultiSelect"
|
|
|
|
|
id="persons"
|
|
|
|
|
name="persons[]"
|
|
|
|
|
label="<?= lang('Person.episode_form.persons') ?>"
|
|
|
|
|
hint="<?= lang('Person.episode_form.persons_hint') ?>"
|
|
|
|
|
options="<?= htmlspecialchars(json_encode($personOptions)) ?>"
|
|
|
|
|
selected="<?= htmlspecialchars(json_encode(old('persons', []))) ?>"
|
|
|
|
|
required="true"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Forms.Field
|
|
|
|
|
as="MultiSelect"
|
|
|
|
|
id="roles"
|
|
|
|
|
name="roles[]"
|
|
|
|
|
label="<?= lang('Person.episode_form.roles') ?>"
|
|
|
|
|
hint="<?= lang('Person.episode_form.roles_hint') ?>"
|
|
|
|
|
options="<?= htmlspecialchars(json_encode($taxonomyOptions)) ?>"
|
|
|
|
|
selected="<?= htmlspecialchars(json_encode(old('roles', []))) ?>"
|
|
|
|
|
required="true"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Button variant="primary" type="submit" class="self-end"><?= lang('Person.episode_form.submit_add') ?></Button>
|
|
|
|
|
|
|
|
|
|
</Forms.Section>
|
|
|
|
|
|
|
|
|
|
</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'),
|
2021-05-17 17:11:23 +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) .
|
|
|
|
|
"\"><img src=\"{$person->image->thumbnail_url}\" alt=\"{$person->full_name}\" class=\"object-cover w-16 h-16 rounded-full\" /></a>" .
|
2021-02-10 16:20:01 +00:00
|
|
|
|
'<div class="flex flex-col ml-3">' .
|
2021-05-17 17:11:23 +00:00
|
|
|
|
$person->full_name .
|
|
|
|
|
implode(
|
|
|
|
|
'',
|
|
|
|
|
array_map(function ($role) {
|
|
|
|
|
return '<span class="text-sm text-gray-600">' .
|
|
|
|
|
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
|
|
|
|
? ''
|
2021-05-17 17:11:23 +00:00
|
|
|
|
: "<a href=\"{$person->information_url}\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"text-sm text-blue-800 hover:underline\">" .
|
2021-08-19 14:00:14 +00:00
|
|
|
|
$person->information_url .
|
|
|
|
|
'</a>') .
|
2021-02-10 16:20:01 +00:00
|
|
|
|
'</div></div>';
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'header' => lang('Common.actions'),
|
2021-05-17 17:11:23 +00:00
|
|
|
|
'cell' => function ($person): string {
|
2021-09-22 14:50:54 +00:00
|
|
|
|
return '<Button uri="' . route_to('episode-person-remove', $person->podcast_id, $person->episode_id, $person->id) . '" variant="danger" size="small" iconLeft="delete-bin">' . lang('Person.episode_form.remove') . '</Button>';
|
2021-02-10 16:20:01 +00:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
2021-05-17 17:11:23 +00:00
|
|
|
|
$episode->persons,
|
2021-10-18 16:44:07 +00:00
|
|
|
|
'max-w-xl mt-6'
|
2021-02-10 16:20:01 +00:00
|
|
|
|
) ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|