refactor: rewrite form pages using form helper

- add installGateway to app config
- update route names and groups
- remove `author_name` and `author_email` from `episodes` table
- remove `author_name` and `author_email` from `podcasts` table
- remove `owner_id` + add `created_by` and `updated_by` fields in `podcasts` and `episodes` tables
- remove unnecessary comments in database fields
- remove confirm password inputs from auth forms for better ux
- rename `pub_date` field to `published_at` and add publication time field in episode form

closes #14, #28
This commit is contained in:
Yassine Doghri 2020-08-14 18:27:57 +00:00
commit a1a28de702
59 changed files with 1580 additions and 1158 deletions

View file

@ -7,27 +7,23 @@
<?= $this->section('content') ?>
<form action="<?= route_to(
'user_edit',
$user->id
) ?>" method="post" class="flex flex-col max-w-lg">
<?= csrf_field() ?>
<?= form_open(route_to('user-edit', $user->id), [
'class' => 'flex flex-col max-w-sm',
]) ?>
<?= csrf_field() ?>
<label for="roles"><?= lang('User.form.roles') ?></label>
<select id="roles" name="roles[]" autocomplete="off" class="mb-6 form-multiselect" multiple>
<?php foreach ($roles as $role): ?>
<option value="<?= $role->id ?>"
<?php if (
in_array($role->name, $user->roles)
): ?> selected <?php endif; ?>>
<?= $role->name ?>
</option>
<?php endforeach; ?>
</select>
<?= form_label(lang('User.form.roles'), 'roles') ?>
<?= form_multiselect('roles[]', $roleOptions, $user->roles, [
'id' => 'roles',
'class' => 'form-multiselect mb-4',
]) ?>
<button type="submit" class="px-4 py-2 ml-auto border">
<?= lang('User.form.submit_edit') ?>
</button>
</form>
<?= form_button([
'content' => lang('User.form.submit_edit'),
'type' => 'submit',
'class' => 'self-end px-4 py-2 bg-gray-200',
]) ?>
<?= form_close() ?>
<?= $this->endSection() ?>