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') ?>
|
|
|
|
|
|
2022-01-02 15:11:05 +01:00
|
|
|
|
<form action="<?= route_to('episode-persons-manage', $podcast->id, $episode->id) ?>" method="POST" class="max-w-xl">
|
2021-10-18 18:44:07 +02:00
|
|
|
|
<?= 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') ?>"
|
2022-01-05 15:58:53 +01:00
|
|
|
|
options="<?= esc(json_encode($personOptions)) ?>"
|
|
|
|
|
selected="<?= esc(json_encode(old('persons', []))) ?>"
|
2021-10-18 18:44:07 +02:00
|
|
|
|
required="true"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Forms.Field
|
|
|
|
|
as="MultiSelect"
|
|
|
|
|
id="roles"
|
|
|
|
|
name="roles[]"
|
|
|
|
|
label="<?= lang('Person.episode_form.roles') ?>"
|
|
|
|
|
hint="<?= lang('Person.episode_form.roles_hint') ?>"
|
2022-01-05 15:58:53 +01:00
|
|
|
|
options="<?= esc(json_encode($taxonomyOptions)) ?>"
|
|
|
|
|
selected="<?= esc(json_encode(old('roles', []))) ?>"
|
2021-10-18 18:44:07 +02:00
|
|
|
|
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) .
|
2022-03-04 15:33:48 +01:00
|
|
|
|
'"><img src="' . $person->avatar->thumbnail_url . '" alt="' . esc($person->full_name) . '" class="object-cover w-16 rounded-full aspect-square" loading="lazy" /></a>' .
|
2021-02-10 17:20:01 +01:00
|
|
|
|
'<div class="flex flex-col ml-3">' .
|
2022-03-04 15:33:48 +01:00
|
|
|
|
esc($person->full_name) .
|
2021-05-17 19:11:23 +02:00
|
|
|
|
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
|
|
|
|
? ''
|
2022-03-04 15:33:48 +01: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 16:00:14 +02:00
|
|
|
|
'</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() ?>
|