xref: /webtrees/resources/views/admin/users-create.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
10c0910bfSGreg Roach<?php
2dd6b2bfcSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
50c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
64c3563c0SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UserAddAction;
74c3563c0SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UserListPage;
80c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
90c0910bfSGreg Roachuse Fisharebest\Webtrees\View;
100c0910bfSGreg Roach
117c2c99faSGreg Roach/**
127c2c99faSGreg Roach * @var string $email
137c2c99faSGreg Roach * @var string $real_name
147c2c99faSGreg Roach * @var string $title
157c2c99faSGreg Roach * @var string $username
167c2c99faSGreg Roach */
177c2c99faSGreg Roach
180c0910bfSGreg Roach?>
190c0910bfSGreg Roach
204c3563c0SGreg Roach<?= view('components/breadcrumbs', ['links' => [
214c3563c0SGreg Roach    route(ControlPanel::class) => I18N::translate('Control panel'),
224c3563c0SGreg Roach    route(UserListPage::class) => I18N::translate('User administration'),
234c3563c0SGreg Roach    $title,
244c3563c0SGreg Roach]]) ?>
25dd6b2bfcSGreg Roach
26dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
27dd6b2bfcSGreg Roach
284c3563c0SGreg Roach<form method="post" action="<?= e(route(UserAddAction::class)) ?>" class="form-horizontal" autocomplete="off">
29dd6b2bfcSGreg Roach    <!-- REAL NAME -->
309e3c2cf9SGreg Roach    <div class="row mb-3">
31dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="real_name">
32dd6b2bfcSGreg Roach            <?= I18N::translate('Real name') ?>
33dd6b2bfcSGreg Roach        </label>
34dd6b2bfcSGreg Roach        <div class="col-sm-9">
357dca5265SGreg Roach            <input class="form-control" type="text" id="real_name" name="real_name" required="required" maxlength="64" value="<?= e($real_name) ?>" dir="auto">
36315eb316SGreg Roach            <div class="form-text">
37dd6b2bfcSGreg Roach                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
38315eb316SGreg Roach            </div>
39dd6b2bfcSGreg Roach        </div>
40dd6b2bfcSGreg Roach    </div>
41dd6b2bfcSGreg Roach
42dd6b2bfcSGreg Roach    <!-- USER NAME -->
439e3c2cf9SGreg Roach    <div class="row mb-3">
44dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="username">
45dd6b2bfcSGreg Roach            <?= I18N::translate('Username') ?>
46dd6b2bfcSGreg Roach        </label>
47dd6b2bfcSGreg Roach        <div class="col-sm-9">
487dca5265SGreg Roach            <input class="form-control" type="text" id="username" name="username" required="required" maxlength="32" value="<?= e($username) ?>" dir="auto">
49315eb316SGreg Roach            <div class="form-text">
50dd6b2bfcSGreg Roach                <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?>
51315eb316SGreg Roach            </div>
52dd6b2bfcSGreg Roach        </div>
53dd6b2bfcSGreg Roach    </div>
54dd6b2bfcSGreg Roach
55dd6b2bfcSGreg Roach    <!-- PASSWORD -->
569e3c2cf9SGreg Roach    <div class="row mb-3">
57510d3f2fSGreg Roach        <label class="col-sm-3 col-form-label" for="password">
58dd6b2bfcSGreg Roach            <?= I18N::translate('Password') ?>
59dd6b2bfcSGreg Roach        </label>
60dd6b2bfcSGreg Roach        <div class="col-sm-9">
61d4786c66SGreg Roach            <input class="form-control" type="password" id="password" name="password" pattern = ".{8,}" placeholder="<?= I18N::plural('Use at least %s character.', 'Use at least %s characters.', 8, I18N::number(8)) ?>" required="required" autocomplete="new-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')) ?>">
62315eb316SGreg Roach            <div class="form-text">
6354bcf2f0SRico Sonntag                <?= I18N::translate('Passwords must be at least 8 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?>
64315eb316SGreg Roach            </div>
65dd6b2bfcSGreg Roach        </div>
66dd6b2bfcSGreg Roach    </div>
67dd6b2bfcSGreg Roach
68dd6b2bfcSGreg Roach    <!-- EMAIL ADDRESS -->
699e3c2cf9SGreg Roach    <div class="row mb-3">
70dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label" for="email">
71dd6b2bfcSGreg Roach            <?= I18N::translate('Email address') ?>
72dd6b2bfcSGreg Roach        </label>
73dd6b2bfcSGreg Roach        <div class="col-sm-9">
747dca5265SGreg Roach            <input class="form-control" type="email" id="email" name="email" required="required" maxlength="64" value="<?= e($email) ?>">
75315eb316SGreg Roach            <div class="form-text">
76dd6b2bfcSGreg Roach                <?= I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.') ?>
77315eb316SGreg Roach            </div>
78dd6b2bfcSGreg Roach        </div>
79dd6b2bfcSGreg Roach    </div>
80dd6b2bfcSGreg Roach
819e3c2cf9SGreg Roach    <div class="row mb-3">
82dd6b2bfcSGreg Roach        <div class="offset-sm-3 col-sm-9">
83dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
84dd6b2bfcSGreg Roach                <?= I18N::translate('save') ?>
85dd6b2bfcSGreg Roach            </button>
86dd6b2bfcSGreg Roach        </div>
87dd6b2bfcSGreg Roach    </div>
8881443e3cSGreg Roach
8981443e3cSGreg Roach    <?= csrf_field() ?>
90dd6b2bfcSGreg Roach</form>
91dd6b2bfcSGreg Roach
92dd6b2bfcSGreg Roach<?php View::push('javascript') ?>
93dd6b2bfcSGreg Roach<script>
94dd6b2bfcSGreg Roach  function regex_quote(str) {
95d97c97e8SGreg Roach    return str.replace(/[\\.?+*()[\]{}|]/g, "\\$&");
96dd6b2bfcSGreg Roach  }
97dd6b2bfcSGreg Roach</script>
98dd6b2bfcSGreg Roach<?php View::endpush() ?>
99