xref: /webtrees/resources/views/login-page.phtml (revision 510d3f2f742dbbb1c1c6bf2c67f577737dd49b89)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<?php if ($error) : ?>
5    <div class="alert alert-danger">
6        <?= $error ?>
7    </div>
8<?php endif ?>
9
10<h2 class="wt-page-title">
11    <?= I18N::translate('Welcome to this genealogy website') ?>
12</h2>
13
14<p>
15    <?= nl2br($welcome, false) ?>
16</p>
17
18<form action="<?= e(route('login')) ?>" class="wt-page-options wt-page-options-login" method="post">
19    <?= csrf_field() ?>
20    <input type="hidden" name="url" value="<?= e($url) ?>">
21
22    <div class="form-group row">
23        <label class="col-sm-3 col-form-label wt-page-options-label" for="username">
24            <?= I18N::translate('Username') ?>
25        </label>
26        <div class="col-sm-9 wt-page-options-value">
27            <input class="form-control" type="text" id="username" name="username" required value="<?= e($username) ?>">
28        </div>
29    </div>
30
31    <div class="form-group row">
32        <label class="col-sm-3 col-form-label wt-page-options-label" for="password">
33            <?= I18N::translate('Password') ?>
34        </label>
35        <div class="col-sm-9 wt-page-options-value">
36            <input autocomplete="current-password" class="form-control" id="password" name="password" required type="password">
37        </div>
38    </div>
39
40    <div class="form-group row">
41        <div class="col-sm-3 col-form-label wt-page-options-label">
42        </div>
43        <div class="col-sm-9 wt-page-options-value">
44            <button class="btn btn-primary" type="submit">
45                <?= /* I18N: A button label. */ I18N::translate('sign in') ?>
46            </button>
47            <!--
48            Emails are sent from a TREE, not from a SITE. Therefore if there is no
49            tree available (initial setup or all trees private), then we can't send email.
50            -->
51            <?php if ($tree) : ?>
52                <a class="btn btn-link" href="<?= e(route('forgot-password')) ?>">
53                    <?= I18N::translate('Forgot password?') ?>
54                </a>
55
56                <?php if ($can_register) : ?>
57                    <a class="btn btn-link" href="<?= e(route('register')) ?>">
58                        <?= I18N::translate('Request a new user account') ?>
59                    </a>
60                <?php endif ?>
61            <?php endif ?>
62        </div>
63    </div>
64</form>
65
66<?php View::push('javascript') ?>
67<script>
68    $('#password').hideShowPassword('infer', true);
69</script>
70<?php View::endpush() ?>
71