xref: /webtrees/resources/views/login-page.phtml (revision 9e3c2cf9009c4c2140f50ddfc80b91f2f82cdce5)
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 Roach
94c9729fbSGreg Roach/**
107c2c99faSGreg Roach * @var bool      $can_register
114c9729fbSGreg Roach * @var string    $error
127c2c99faSGreg Roach * @var Tree|null $tree
134c9729fbSGreg Roach * @var string    $url
144c9729fbSGreg Roach * @var string    $username
157c2c99faSGreg Roach * @var string    $warning
167c2c99faSGreg Roach * @var string    $welcome
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
32*9e3c2cf9SGreg Roach    <div class="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">
377dca5265SGreg Roach            <input class="form-control" type="text" id="username" name="username" required="required" value="<?= e($username) ?>" autocomplete="username">
38dd6b2bfcSGreg Roach        </div>
39dd6b2bfcSGreg Roach    </div>
40dd6b2bfcSGreg Roach
41*9e3c2cf9SGreg Roach    <div class="row mb-3">
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">
46d4786c66SGreg Roach            <input autocomplete="current-password" class="form-control" id="password" name="password" required="required" type="password" data-wt-show-password-text="<?= e(I18N::translate('show')) ?>" data-wt-show-password-title="<?= e(I18N::translate('Show password')) ?>" data-wt-hide-password-text="<?= e(I18N::translate('hide')) ?>" data-wt-hide-password-title="<?= e(I18N::translate('Hide password')) ?>">
47dd6b2bfcSGreg Roach        </div>
48dd6b2bfcSGreg Roach    </div>
49dd6b2bfcSGreg Roach
50*9e3c2cf9SGreg Roach    <div class="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
59f917a287SGreg 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>
71