mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-13 17:55:47 +00:00

- add AuthSeeder to bootstrap authorization data and remove UserSeeder - create a superadmin group having all authorizations - refactor routes and controller methods to separate get and post requests - refactor admin views with a title section in layout - add contributors section to podcasts to manage contributions (add, edit roles and remove) closes #3, #18
49 lines
1.6 KiB
PHP
49 lines
1.6 KiB
PHP
<?= $this->extend('admin/_layout') ?>
|
|
|
|
<?= $this->section('title') ?>
|
|
<?= lang('Contributor.add_contributor', [$podcast->title]) ?>
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
<form action="<?= route_to(
|
|
'contributor_add',
|
|
$podcast->id
|
|
) ?>" method="post" class="flex flex-col max-w-lg">
|
|
<?= csrf_field() ?>
|
|
|
|
<div class="flex flex-col mb-4">
|
|
<label for="user"><?= lang('Contributor.form.user') ?></label>
|
|
<select id="user" name="user" autocomplete="off" class="form-select" required>
|
|
<?php foreach ($users as $user): ?>
|
|
<option value="<?= $user->id ?>"
|
|
<?php if (
|
|
old('user') == $user->id
|
|
): ?> selected <?php endif; ?>>
|
|
<?= $user->username ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="flex flex-col mb-4">
|
|
<label for="role"><?= lang('Contributor.form.role') ?></label>
|
|
<select id="role" name="role" autocomplete="off" class="form-select" required>
|
|
<?php foreach ($roles as $role): ?>
|
|
<option value="<?= $role->id ?>"
|
|
<?php if (
|
|
old('role') == $role->id
|
|
): ?> selected <?php endif; ?>>
|
|
<?= $role->name ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<button type="submit" name="submit" class="self-end px-4 py-2 bg-gray-200"><?= lang(
|
|
'Contributor.form.submit_add'
|
|
) ?></button>
|
|
</form>
|
|
|
|
<?= $this->endSection() ?>
|