Skip to content

Commit 6fd86e0

Browse files
committed
Improved user experience in forms
1 parent 970c67e commit 6fd86e0

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

src/Views/email_activate_show.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
<?= csrf_field() ?>
2020

2121
<!-- Code -->
22-
<div class="mb-2">
23-
<input type="text" class="form-control" name="token" placeholder="000000" inputmode="numeric"
22+
<div class="form-floating mb-2">
23+
<input type="text" class="form-control" id="floatingTokenInput" name="token" placeholder="000000" inputmode="numeric"
2424
pattern="[0-9]*" autocomplete="one-time-code" value="<?= old('token') ?>" required />
25+
<label for="floatingTokenInput">Token</label>
2526
</div>
2627

2728
<div class="d-grid col-8 mx-auto m-3">

src/Views/login.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
<?= csrf_field() ?>
3333

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

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

4446
<!-- Remember me -->

src/Views/magic_link_form.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
<?= csrf_field() ?>
2929

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

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

src/Views/register.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,27 @@
2828
<?= csrf_field() ?>
2929

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

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

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

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

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

0 commit comments

Comments
 (0)