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') ?>
|
|
|
|
|
|
|
|
|
|
<?= data_table(
|
|
|
|
|
[
|
|
|
|
|
[
|
2021-09-15 15:58:21 +00:00
|
|
|
|
'header' => lang('Person.podcast_form.persons'),
|
2021-05-17 17:11:23 +00:00
|
|
|
|
'cell' => function ($person) {
|
|
|
|
|
return '<div class="flex">' .
|
|
|
|
|
'<a href="' .
|
|
|
|
|
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>" .
|
|
|
|
|
'<div class="flex flex-col ml-3">' .
|
|
|
|
|
$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
|
|
|
|
|
? ''
|
|
|
|
|
: "<a href=\"{$person->information_url}\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"text-sm text-blue-800 hover:underline\">" .
|
|
|
|
|
$person->information_url .
|
|
|
|
|
'</a>') .
|
|
|
|
|
'</div></div>';
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'header' => lang('Common.actions'),
|
|
|
|
|
'cell' => function ($person): string {
|
2021-09-20 15:45:38 +00:00
|
|
|
|
return '<Button uri="' . route_to('podcast-person-remove', $person->podcast_id, $person->id) . '" variant="danger" size="small">' . lang('Person.podcast_form.remove') . '</Button>';
|
2021-05-17 17:11:23 +00:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
$podcast->persons,
|
|
|
|
|
) ?>
|
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<form action="<?= route_to('podcast-person-edit', $podcast->id) ?>" method="POST" class="mt-6">
|
|
|
|
|
<?= csrf_field() ?>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<Forms.Section
|
|
|
|
|
title="<?= lang('Person.podcast_form.add_section_title') ?>"
|
|
|
|
|
subtitle="<?= lang('Person.podcast_form.add_section_subtitle') ?>"
|
|
|
|
|
>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<Forms.Label for="persons" hint="<?= lang('Person.podcast_form.persons_hint') ?>"><?= lang('Person.podcast_form.persons') ?></Forms.Label>
|
|
|
|
|
<Forms.MultiSelect id="persons" name="persons[]" class="mb-4" required="required" options="<?= esc(json_encode($personOptions)) ?>" selected="<?= esc(json_encode(old('persons', []))) ?>"/>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<Forms.Label for="roles" hint="<?= lang('Person.podcast_form.roles_hint') ?>" isOptional="true"><?= lang('Person.podcast_form.roles') ?></Forms.Label>
|
|
|
|
|
<Forms.MultiSelect id="roles" name="roles[]" class="mb-4" options="<?= esc(json_encode($taxonomyOptions)) ?>" selected="<?= esc(json_encode(old('roles', []))) ?>"/>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
<Button variant="primary" class="self-end" type="submit"><?= lang('Person.podcast_form.submit_add') ?></Button>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
2021-09-15 15:58:21 +00:00
|
|
|
|
</Forms.Section>
|
|
|
|
|
|
|
|
|
|
</form>
|
2021-05-17 17:11:23 +00:00
|
|
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|