2021-09-02 16:34:25 +00:00
|
|
|
|
<?= $this->extend('_layout') ?>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
|
|
|
|
<?= $this->section('title') ?>
|
|
|
|
|
<?= lang('Person.podcast_form.title') ?>
|
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
|
|
|
|
<?= lang('Person.podcast_form.title') ?> (<?= count($podcast->persons) ?>)
|
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('headerRight') ?>
|
2021-09-20 15:45:38 +00:00
|
|
|
|
<Button uri="<?= route_to('person-create') ?>" variant="primary" iconLeft="add"><?= lang('Person.create') ?></Button>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
|
2022-01-02 14:11:05 +00:00
|
|
|
|
<form action="<?= route_to('podcast-persons-manage', $podcast->id) ?>" method="POST" class="max-w-xl">
|
2021-10-18 16:44:07 +00:00
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
|
|
|
|
<Forms.Section
|
|
|
|
|
title="<?= lang('Person.podcast_form.add_section_title') ?>"
|
|
|
|
|
subtitle="<?= lang('Person.podcast_form.add_section_subtitle') ?>"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<Forms.Field
|
|
|
|
|
as="MultiSelect"
|
|
|
|
|
id="persons"
|
|
|
|
|
name="persons[]"
|
2024-01-24 16:48:23 +00:00
|
|
|
|
label="<?= esc(lang('Person.podcast_form.persons')) ?>"
|
|
|
|
|
hint="<?= esc(lang('Person.podcast_form.persons_hint')) ?>"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
options="<?= esc(json_encode($personOptions)) ?>"
|
|
|
|
|
selected="<?= esc(json_encode(old('persons', []))) ?>"
|
|
|
|
|
required="true" />
|
2023-11-15 14:20:41 +00:00
|
|
|
|
|
2021-10-18 16:44:07 +00:00
|
|
|
|
<Forms.Field
|
|
|
|
|
as="MultiSelect"
|
|
|
|
|
id="roles"
|
|
|
|
|
name="roles[]"
|
2024-01-24 16:48:23 +00:00
|
|
|
|
label="<?= esc(lang('Person.podcast_form.roles')) ?>"
|
|
|
|
|
hint="<?= esc(lang('Person.podcast_form.roles_hint')) ?>"
|
2021-10-18 16:44:07 +00:00
|
|
|
|
options="<?= esc(json_encode($taxonomyOptions)) ?>"
|
|
|
|
|
selected="<?= esc(json_encode(old('roles', []))) ?>"
|
2023-11-15 14:20:41 +00:00
|
|
|
|
/>
|
2021-10-18 16:44:07 +00:00
|
|
|
|
|
|
|
|
|
<Button variant="primary" class="self-end" type="submit"><?= lang('Person.podcast_form.submit_add') ?></Button>
|
|
|
|
|
|
|
|
|
|
</Forms.Section>
|
|
|
|
|
</form>
|
|
|
|
|
|
2021-05-17 17:11:23 +00:00
|
|
|
|
<?= data_table(
|
|
|
|
|
[
|
|
|
|
|
[
|
2021-09-15 15:58:21 +00:00
|
|
|
|
'header' => lang('Person.podcast_form.persons'),
|
2023-06-12 14:47:38 +00:00
|
|
|
|
'cell' => function ($person) {
|
2021-05-17 17:11:23 +00:00
|
|
|
|
return '<div class="flex">' .
|
|
|
|
|
'<a href="' .
|
|
|
|
|
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 h-16 rounded-full aspect-square" loading="lazy" /></a>' .
|
2021-05-17 17:11:23 +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
|
|
|
|
|
? ''
|
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-05-17 17:11:23 +00:00
|
|
|
|
'</a>') .
|
|
|
|
|
'</div></div>';
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'header' => lang('Common.actions'),
|
2023-06-12 14:47:38 +00:00
|
|
|
|
'cell' => function ($person): string {
|
2021-09-21 15:51:04 +00:00
|
|
|
|
return '<Button uri="' . route_to('podcast-person-remove', $person->podcast_id, $person->id) . '" variant="danger" size="small" iconLeft="delete-bin">' . lang('Person.podcast_form.remove') . '</Button>';
|
2021-05-17 17:11:23 +00:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
$podcast->persons,
|
2021-10-18 16:44:07 +00:00
|
|
|
|
'max-w-xl mt-6'
|
2021-05-17 17:11:23 +00:00
|
|
|
|
) ?>
|
|
|
|
|
|
2021-09-21 15:51:04 +00:00
|
|
|
|
<?= $this->endSection() ?>
|