2021-09-02 18:34:25 +02:00
|
|
|
|
<?= $this->extend('_layout') ?>
|
2021-02-10 17:20:01 +01:00
|
|
|
|
|
|
|
|
|
<?= $this->section('title') ?>
|
|
|
|
|
<?= lang('Person.episode_form.title') ?>
|
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
2021-05-17 19:11:23 +02:00
|
|
|
|
<?= lang('Person.episode_form.title') ?> (<?= count($episode->persons) ?>)
|
2021-02-10 17:20:01 +01:00
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('headerRight') ?>
|
2021-09-15 17:58:21 +02:00
|
|
|
|
<Button variant="primary" uri="<?= route_to('person-create') ?>" iconLeft="add"><?= lang('Person.create') ?></Button>
|
2021-02-10 17:20:01 +01:00
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
|
2021-10-18 18:44:07 +02: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 17:20:01 +01:00
|
|
|
|
<?= data_table(
|
|
|
|
|
[
|
|
|
|
|
[
|
2021-09-15 17:58:21 +02:00
|
|
|
|
'header' => lang('Person.episode_form.persons'),
|
2021-05-17 19:11:23 +02:00
|
|
|
|
'cell' => function ($person) {
|
2021-02-10 17:20:01 +01:00
|
|
|
|
return '<div class="flex">' .
|
|
|
|
|
'<a href="' .
|
2021-05-17 19:11:23 +02:00
|
|
|
|
route_to('person-view', $person->id) .
|
2021-11-23 12:54:34 +01:00
|
|
|
|
"\"><img src=\"{$person->avatar->thumbnail_url}\" alt=\"{$person->full_name}\" class=\"object-cover w-16 rounded-full aspect-square\" /></a>" .
|
2021-02-10 17:20:01 +01:00
|
|
|
|
'<div class="flex flex-col ml-3">' .
|
2021-05-17 19:11:23 +02:00
|
|
|
|
$person->full_name .
|
|
|
|
|
implode(
|
|
|
|
|
'',
|
|
|
|
|
array_map(function ($role) {
|
2021-11-05 15:36:34 +01:00
|
|
|
|
return '<span class="text-sm text-skin-muted">' .
|
2021-05-17 19:11:23 +02: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 17:20:01 +01:00
|
|
|
|
? ''
|
2021-11-05 15:36:34 +01:00
|
|
|
|
: "<a href=\"{$person->information_url}\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"font-semibold text-sm text-accent-base hover:text-accent-hover\">" .
|
2021-08-19 16:00:14 +02:00
|
|
|
|
$person->information_url .
|
|
|
|
|
'</a>') .
|
2021-02-10 17:20:01 +01:00
|
|
|
|
'</div></div>';
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'header' => lang('Common.actions'),
|
2021-05-17 19:11:23 +02:00
|
|
|
|
'cell' => function ($person): string {
|
2021-09-22 16:50:54 +02: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 17:20:01 +01:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
2021-05-17 19:11:23 +02:00
|
|
|
|
$episode->persons,
|
2021-10-18 18:44:07 +02:00
|
|
|
|
'max-w-xl mt-6'
|
2021-02-10 17:20:01 +01:00
|
|
|
|
) ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|