xref: /webtrees/resources/views/modules/login_block/sign-in.phtml (revision 56f9a9c1fdf345d30ac6cd9caefe7542153b9246)
1*56f9a9c1SGreg Roach<?php
2*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\LoginAction;
3*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestAction;
4*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\RegisterPage;
5*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\I18N;
6*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\View;
7*56f9a9c1SGreg Roach?>
8dd6b2bfcSGreg Roach
9*56f9a9c1SGreg Roach<form method="post" action="<?= route(LoginAction::class, ['url' => route('user-page', ['ged' => $tree->name()])]) ?>" name="login-form">
10dd6b2bfcSGreg Roach    <?= csrf_field() ?>
11d8d70c25SGreg Roach    <input type="hidden" name="url" value="<?= e($url) ?>">
12dd6b2bfcSGreg Roach
13dd6b2bfcSGreg Roach    <div class="form-group">
14dd6b2bfcSGreg Roach        <label for="username">
15dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
16dd6b2bfcSGreg Roach        </label>
17dd6b2bfcSGreg Roach        <input type="text" id="username" name="username" class="form-control">
18dd6b2bfcSGreg Roach    </div>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach    <div class="form-group">
21dd6b2bfcSGreg Roach        <label for="password">
22dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
23dd6b2bfcSGreg Roach        </label>
24dd6b2bfcSGreg Roach        <input type="password" id="password" name="password" class="form-control" autocomplete="current-password">
25dd6b2bfcSGreg Roach    </div>
26dd6b2bfcSGreg Roach
27dd6b2bfcSGreg Roach    <div>
28dd6b2bfcSGreg Roach        <button type="submit" class="btn btn-primary">
29dd6b2bfcSGreg Roach            <?= /* I18N: A button label. */ I18N::translate('sign in') ?>
30dd6b2bfcSGreg Roach        </button>
31dd6b2bfcSGreg Roach
32dd6b2bfcSGreg Roach        <button type="button" class="btn btn-secondary" data-toggle="collapse" data-target="#forgot-password" aria-expanded="false" aria-controls="forgot-password">
33dd6b2bfcSGreg Roach            <?= I18N::translate('Forgot password?') ?>
34dd6b2bfcSGreg Roach        </button>
35dd6b2bfcSGreg Roach    </div>
36dd6b2bfcSGreg Roach</form>
37dd6b2bfcSGreg Roach
38dd6b2bfcSGreg Roach<?php if ($allow_register) : ?>
39*56f9a9c1SGreg Roach    <a class="btn btn-link" href="<?= e(route(RegisterPage::class)) ?>">
40dd6b2bfcSGreg Roach        <?= I18N::translate('Request a new user account') ?>
41dd6b2bfcSGreg Roach    </a>
42dd6b2bfcSGreg Roach<?php endif ?>
43dd6b2bfcSGreg Roach
44dd6b2bfcSGreg Roach<div class="collapse" id="forgot-password">
45*56f9a9c1SGreg Roach    <form method="post" action="<?= e(route(PasswordRequestAction::class)) ?>">
46dd6b2bfcSGreg Roach        <?= I18N::translate('Request a new password') ?>
47dd6b2bfcSGreg Roach        <div class="form-group">
48dd6b2bfcSGreg Roach            <label for="new_passwd_username">
49dd6b2bfcSGreg Roach                <?= I18N::translate('Username or email address') ?>
50dd6b2bfcSGreg Roach                <input type="text" id="new_passwd_username" name="new_passwd_username" class="form-control">
51dd6b2bfcSGreg Roach            </label>
52dd6b2bfcSGreg Roach        </div>
53dd6b2bfcSGreg Roach        <div>
54dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
55dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */ I18N::translate('continue') ?>
56dd6b2bfcSGreg Roach            </button>
57dd6b2bfcSGreg Roach        </div>
58dd6b2bfcSGreg Roach    </form>
59dd6b2bfcSGreg Roach</div>
60dd6b2bfcSGreg Roach
61510d3f2fSGreg Roach<?php View::push('javascript') ?>
62510d3f2fSGreg Roach<script>
63510d3f2fSGreg Roach    $('#password').hideShowPassword('infer', true);
64510d3f2fSGreg Roach</script>
65510d3f2fSGreg Roach<?php View::endpush() ?>
66510d3f2fSGreg Roach
67