xref: /webtrees/resources/views/modules/login_block/sign-in.phtml (revision 8e0e1b25d26151378cec98290280e1e3dc075ff7)
156f9a9c1SGreg Roach<?php
291c514e5SGreg Roach
356f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\LoginAction;
456f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestAction;
556f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\RegisterPage;
6*8e0e1b25SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UserPage;
756f9a9c1SGreg Roachuse Fisharebest\Webtrees\I18N;
89fa6ab69SGreg Roachuse Fisharebest\Webtrees\Tree;
956f9a9c1SGreg Roachuse Fisharebest\Webtrees\View;
1091c514e5SGreg Roach
1156f9a9c1SGreg Roach?>
12dd6b2bfcSGreg Roach
1371359d06SGreg Roach<form method="post" action="<?= route(LoginAction::class, ['tree' => $tree->name()]) ?>" name="login-form">
14dd6b2bfcSGreg Roach    <?= csrf_field() ?>
15*8e0e1b25SGreg Roach    <input type="hidden" name="url" value="<?= e(route(UserPage::class, ['tree' => $tree->name()])) ?>">
16dd6b2bfcSGreg Roach
17dd6b2bfcSGreg Roach    <div class="form-group">
18dd6b2bfcSGreg Roach        <label for="username">
19dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
20dd6b2bfcSGreg Roach        </label>
21dd6b2bfcSGreg Roach        <input type="text" id="username" name="username" class="form-control">
22dd6b2bfcSGreg Roach    </div>
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach    <div class="form-group">
25dd6b2bfcSGreg Roach        <label for="password">
26dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
27dd6b2bfcSGreg Roach        </label>
28dd6b2bfcSGreg Roach        <input type="password" id="password" name="password" class="form-control" autocomplete="current-password">
29dd6b2bfcSGreg Roach    </div>
30dd6b2bfcSGreg Roach
31dd6b2bfcSGreg Roach    <div>
32dd6b2bfcSGreg Roach        <button type="submit" class="btn btn-primary">
33dd6b2bfcSGreg Roach            <?= /* I18N: A button label. */ I18N::translate('sign in') ?>
34dd6b2bfcSGreg Roach        </button>
35dd6b2bfcSGreg Roach
36dd6b2bfcSGreg Roach        <button type="button" class="btn btn-secondary" data-toggle="collapse" data-target="#forgot-password" aria-expanded="false" aria-controls="forgot-password">
37dd6b2bfcSGreg Roach            <?= I18N::translate('Forgot password?') ?>
38dd6b2bfcSGreg Roach        </button>
39dd6b2bfcSGreg Roach    </div>
40dd6b2bfcSGreg Roach</form>
41dd6b2bfcSGreg Roach
42dd6b2bfcSGreg Roach<?php if ($allow_register) : ?>
439fa6ab69SGreg Roach    <a class="btn btn-link" href="<?= e(route(RegisterPage::class, ['tree' => $tree->name()])) ?>">
44dd6b2bfcSGreg Roach        <?= I18N::translate('Request a new user account') ?>
45dd6b2bfcSGreg Roach    </a>
46dd6b2bfcSGreg Roach<?php endif ?>
47dd6b2bfcSGreg Roach
48dd6b2bfcSGreg Roach<div class="collapse" id="forgot-password">
49f917a287SGreg Roach    <form method="post" action="<?= e(route(PasswordRequestAction::class, ['tree' => $tree instanceof Tree ? $tree->name() : null])) ?>">
50dd6b2bfcSGreg Roach        <?= I18N::translate('Request a new password') ?>
51dd6b2bfcSGreg Roach        <div class="form-group">
52dd6b2bfcSGreg Roach            <label for="new_passwd_username">
53dd6b2bfcSGreg Roach                <?= I18N::translate('Username or email address') ?>
54dd6b2bfcSGreg Roach                <input type="text" id="new_passwd_username" name="new_passwd_username" class="form-control">
55dd6b2bfcSGreg Roach            </label>
56dd6b2bfcSGreg Roach        </div>
57dd6b2bfcSGreg Roach        <div>
58dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
59dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */ I18N::translate('continue') ?>
60dd6b2bfcSGreg Roach            </button>
61dd6b2bfcSGreg Roach        </div>
62dd6b2bfcSGreg Roach    </form>
63dd6b2bfcSGreg Roach</div>
64dd6b2bfcSGreg Roach
65510d3f2fSGreg Roach<?php View::push('javascript') ?>
66510d3f2fSGreg Roach<script>
67510d3f2fSGreg Roach    $('#password').hideShowPassword('infer', true);
68510d3f2fSGreg Roach</script>
69510d3f2fSGreg Roach<?php View::endpush() ?>
70510d3f2fSGreg Roach
71