Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve user experience in forms #801

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Views/email_activate_show.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<?= csrf_field() ?>

<!-- Code -->
<div class="mb-2">
<input type="text" class="form-control" name="token" placeholder="000000" inputmode="numeric"
<div class="form-floating mb-2">
<input type="text" class="form-control" id="floatingTokenInput" name="token" placeholder="000000" inputmode="numeric"
pattern="[0-9]*" autocomplete="one-time-code" value="<?= old('token') ?>" required />
<label for="floatingTokenInput">Token</label>
sammyskills marked this conversation as resolved.
Show resolved Hide resolved
</div>

<div class="d-grid col-8 mx-auto m-3">
Expand Down
10 changes: 6 additions & 4 deletions src/Views/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
<?= csrf_field() ?>

<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingEmailInput" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
<label for="floatingEmailInput"><?= lang('Auth.email') ?></label>
</div>

<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control" name="password" inputmode="text" autocomplete="current-password" placeholder="<?= lang('Auth.password') ?>" required />
<div class="form-floating mb-3">
<input type="password" class="form-control" id="floatingPasswordInput" name="password" inputmode="text" autocomplete="current-password" placeholder="<?= lang('Auth.password') ?>" required />
<label for="floatingPasswordInput"><?= lang('Auth.password') ?></label>
</div>

<!-- Remember me -->
Expand Down
5 changes: 3 additions & 2 deletions src/Views/magic_link_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
<?= csrf_field() ?>

<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control" name="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>"
<div class="form-floating mb-2">
<input type="email" class="form-control" id="floatingEmailInput" name="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>"
value="<?= old('email', auth()->user()->email ?? null) ?>" required />
<label for="floatingEmailInput"><?= lang('Auth.email') ?></label>
</div>

<div class="d-grid col-12 col-md-8 mx-auto m-3">
Expand Down
20 changes: 12 additions & 8 deletions src/Views/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,27 @@
<?= csrf_field() ?>

<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
<div class="form-floating mb-2">
<input type="email" class="form-control" id="floatingEmailInput" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
<label for="floatingEmailInput"><?= lang('Auth.email') ?></label>
</div>

<!-- Username -->
<div class="mb-4">
<input type="text" class="form-control" name="username" inputmode="text" autocomplete="username" placeholder="<?= lang('Auth.username') ?>" value="<?= old('username') ?>" required />
<div class="form-floating mb-4">
<input type="text" class="form-control" id="floatingUsernameInput" name="username" inputmode="text" autocomplete="username" placeholder="<?= lang('Auth.username') ?>" value="<?= old('username') ?>" required />
<label for="floatingUsernameInput"><?= lang('Auth.username') ?></label>
</div>

<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control" name="password" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.password') ?>" required />
<div class="form-floating mb-2">
<input type="password" class="form-control" id="floatingPasswordInput" name="password" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.password') ?>" required />
<label for="floatingPasswordInput"><?= lang('Auth.password') ?></label>
</div>

<!-- Password (Again) -->
<div class="mb-5">
<input type="password" class="form-control" name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required />
<div class="form-floating mb-5">
<input type="password" class="form-control" id="floatingPasswordConfirmInput" name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required />
<label for="floatingPasswordConfirmInput"><?= lang('Auth.passwordConfirm') ?></label>
</div>

<div class="d-grid col-12 col-md-8 mx-auto m-3">
Expand Down
Loading