Yassine Doghri d58e51874a feat: add user permissions and basic groups to handle authorizations
- 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
2020-10-15 14:41:06 +00:00

36 lines
1.0 KiB
PHP

<?= $this->extend('admin/_layout') ?>
<?= $this->section('title') ?>
<?= lang('Contributor.edit_role', [$user->username]) ?>
<?= $this->endSection() ?>
<?= $this->section('content') ?>
<form action="<?= route_to(
'contributor_edit',
$podcast->id,
$user->id
) ?>" method="post" class="flex flex-col max-w-lg">
<?= csrf_field() ?>
<div class="flex flex-col mb-4">
<label for="category"><?= 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_edit'
) ?></button>
</form>
<?= $this->endSection() ?>