xref: /webtrees/resources/views/login-page.phtml (revision 56f9a9c1fdf345d30ac6cd9caefe7542153b9246)
14c9729fbSGreg Roach<?php
2*56f9a9c1SGreg Roach
3*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\LoginAction;
4*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestPage;
5*56f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\RegisterPage;
64c9729fbSGreg Roachuse Fisharebest\Webtrees\I18N;
74c9729fbSGreg Roachuse Fisharebest\Webtrees\View;
84c9729fbSGreg Roach
94c9729fbSGreg Roach/**
104c9729fbSGreg Roach * @var string $error
114c9729fbSGreg Roach * @var string $warning
124c9729fbSGreg Roach * @var string $welcome
134c9729fbSGreg Roach * @var string $url
144c9729fbSGreg Roach * @var string $username
154c9729fbSGreg Roach * @var bool   $can_register
164c9729fbSGreg Roach */
174c9729fbSGreg Roach?>
18dd6b2bfcSGreg Roach
19dd6b2bfcSGreg Roach<?php if ($error) : ?>
20dd6b2bfcSGreg Roach    <div class="alert alert-danger">
21dd6b2bfcSGreg Roach        <?= $error ?>
22dd6b2bfcSGreg Roach    </div>
23dd6b2bfcSGreg Roach<?php endif ?>
24dd6b2bfcSGreg Roach
25dd6b2bfcSGreg Roach<h2 class="wt-page-title">
26dd6b2bfcSGreg Roach    <?= I18N::translate('Welcome to this genealogy website') ?>
27dd6b2bfcSGreg Roach</h2>
28dd6b2bfcSGreg Roach
29dd6b2bfcSGreg Roach<p>
30dd6b2bfcSGreg Roach    <?= nl2br($welcome, false) ?>
31dd6b2bfcSGreg Roach</p>
32dd6b2bfcSGreg Roach
33*56f9a9c1SGreg Roach<form method="post" action="<?= e(route(LoginAction::class)) ?>" class="wt-page-options wt-page-options-login">
34dd6b2bfcSGreg Roach    <?= csrf_field() ?>
35dd6b2bfcSGreg Roach    <input type="hidden" name="url" value="<?= e($url) ?>">
36dd6b2bfcSGreg Roach
37dd6b2bfcSGreg Roach    <div class="form-group row">
38dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="username">
39dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
40dd6b2bfcSGreg Roach        </label>
41dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
421f1ffa65SGreg Roach            <input class="form-control" type="text" id="username" name="username" required value="<?= e($username) ?>" autocomplete="username">
43dd6b2bfcSGreg Roach        </div>
44dd6b2bfcSGreg Roach    </div>
45dd6b2bfcSGreg Roach
46dd6b2bfcSGreg Roach    <div class="form-group row">
47dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="password">
48dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
49dd6b2bfcSGreg Roach        </label>
50dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
51dd6b2bfcSGreg Roach            <input autocomplete="current-password" class="form-control" id="password" name="password" required type="password">
52dd6b2bfcSGreg Roach        </div>
53dd6b2bfcSGreg Roach    </div>
54dd6b2bfcSGreg Roach
55dd6b2bfcSGreg Roach    <div class="form-group row">
56dd6b2bfcSGreg Roach        <div class="col-sm-3 col-form-label wt-page-options-label">
57dd6b2bfcSGreg Roach        </div>
58dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
59dd6b2bfcSGreg Roach            <button class="btn btn-primary" type="submit">
604c9729fbSGreg Roach                <?= /* I18N: A button label. */
614c9729fbSGreg Roach                I18N::translate('sign in') ?>
62dd6b2bfcSGreg Roach            </button>
634c9729fbSGreg Roach
64*56f9a9c1SGreg Roach            <a class="btn btn-link" href="<?= e(route(PasswordRequestPage::class)) ?>">
65dd6b2bfcSGreg Roach                <?= I18N::translate('Forgot password?') ?>
66dd6b2bfcSGreg Roach            </a>
67dd6b2bfcSGreg Roach
68dd6b2bfcSGreg Roach            <?php if ($can_register) : ?>
69*56f9a9c1SGreg Roach                <a class="btn btn-link" href="<?= e(route(RegisterPage::class)) ?>">
70dd6b2bfcSGreg Roach                    <?= I18N::translate('Request a new user account') ?>
71dd6b2bfcSGreg Roach                </a>
72dd6b2bfcSGreg Roach            <?php endif ?>
73dd6b2bfcSGreg Roach        </div>
74dd6b2bfcSGreg Roach    </div>
75dd6b2bfcSGreg Roach</form>
76510d3f2fSGreg Roach
77510d3f2fSGreg Roach<?php View::push('javascript') ?>
78510d3f2fSGreg Roach<script>
794c9729fbSGreg Roach    $("#password").hideShowPassword("infer", true);
80510d3f2fSGreg Roach</script>
81510d3f2fSGreg Roach<?php View::endpush() ?>
82