xref: /webtrees/resources/views/login-page.phtml (revision f917a287a93831c16eb580f066d00d78ab1f25d9)
14c9729fbSGreg Roach<?php
256f9a9c1SGreg Roach
356f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\LoginAction;
456f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestPage;
556f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\RegisterPage;
64c9729fbSGreg Roachuse Fisharebest\Webtrees\I18N;
786661454SGreg Roachuse Fisharebest\Webtrees\Tree;
84c9729fbSGreg Roachuse Fisharebest\Webtrees\View;
94c9729fbSGreg Roach
104c9729fbSGreg Roach/**
114c9729fbSGreg Roach * @var string $error
124c9729fbSGreg Roach * @var string $warning
134c9729fbSGreg Roach * @var string $welcome
144c9729fbSGreg Roach * @var string $url
154c9729fbSGreg Roach * @var string $username
164c9729fbSGreg Roach * @var bool   $can_register
174c9729fbSGreg Roach */
184c9729fbSGreg Roach?>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach<h2 class="wt-page-title">
21dd6b2bfcSGreg Roach    <?= I18N::translate('Welcome to this genealogy website') ?>
22dd6b2bfcSGreg Roach</h2>
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach<p>
25dd6b2bfcSGreg Roach    <?= nl2br($welcome, false) ?>
26dd6b2bfcSGreg Roach</p>
27dd6b2bfcSGreg Roach
2886661454SGreg Roach<form method="post" action="<?= e(route(LoginAction::class, ['tree' => $tree instanceof Tree ? $tree->name() : null])) ?>" class="wt-page-options wt-page-options-login">
29dd6b2bfcSGreg Roach    <?= csrf_field() ?>
30dd6b2bfcSGreg Roach    <input type="hidden" name="url" value="<?= e($url) ?>">
31dd6b2bfcSGreg Roach
32dd6b2bfcSGreg Roach    <div class="form-group row">
33dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="username">
34dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
35dd6b2bfcSGreg Roach        </label>
36dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
371f1ffa65SGreg Roach            <input class="form-control" type="text" id="username" name="username" required value="<?= e($username) ?>" autocomplete="username">
38dd6b2bfcSGreg Roach        </div>
39dd6b2bfcSGreg Roach    </div>
40dd6b2bfcSGreg Roach
41dd6b2bfcSGreg Roach    <div class="form-group row">
42dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="password">
43dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
44dd6b2bfcSGreg Roach        </label>
45dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
46dd6b2bfcSGreg Roach            <input autocomplete="current-password" class="form-control" id="password" name="password" required type="password">
47dd6b2bfcSGreg Roach        </div>
48dd6b2bfcSGreg Roach    </div>
49dd6b2bfcSGreg Roach
50dd6b2bfcSGreg Roach    <div class="form-group row">
51dd6b2bfcSGreg Roach        <div class="col-sm-3 col-form-label wt-page-options-label">
52dd6b2bfcSGreg Roach        </div>
53dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
54dd6b2bfcSGreg Roach            <button class="btn btn-primary" type="submit">
554c9729fbSGreg Roach                <?= /* I18N: A button label. */
564c9729fbSGreg Roach                I18N::translate('sign in') ?>
57dd6b2bfcSGreg Roach            </button>
584c9729fbSGreg Roach
59*f917a287SGreg Roach            <a class="btn btn-link" href="<?= e(route(PasswordRequestPage::class, ['tree' => $tree instanceof Tree ? $tree->name() : null])) ?>">
60dd6b2bfcSGreg Roach                <?= I18N::translate('Forgot password?') ?>
61dd6b2bfcSGreg Roach            </a>
62dd6b2bfcSGreg Roach
63dd6b2bfcSGreg Roach            <?php if ($can_register) : ?>
649fa6ab69SGreg Roach                <a class="btn btn-link" href="<?= e(route(RegisterPage::class, ['tree' => $tree instanceof Tree ? $tree->name() : null])) ?>">
65dd6b2bfcSGreg Roach                    <?= I18N::translate('Request a new user account') ?>
66dd6b2bfcSGreg Roach                </a>
67dd6b2bfcSGreg Roach            <?php endif ?>
68dd6b2bfcSGreg Roach        </div>
69dd6b2bfcSGreg Roach    </div>
70dd6b2bfcSGreg Roach</form>
71510d3f2fSGreg Roach
72510d3f2fSGreg Roach<?php View::push('javascript') ?>
73510d3f2fSGreg Roach<script>
744c9729fbSGreg Roach    $("#password").hideShowPassword("infer", true);
75510d3f2fSGreg Roach</script>
76510d3f2fSGreg Roach<?php View::endpush() ?>
77