xref: /webtrees/resources/views/edit-account-page.phtml (revision 9ed80f829cfb208ae92f7928345696619569bf4e)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<h2 class="wt-page-title">
5    <?= $title ?>
6</h2>
7
8<form class="wt-page-options wt-page-options-my-account" method="post">
9    <?= csrf_field() ?>
10    <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
11
12    <div class="row form-group">
13        <label class="col-sm-3 col-form-label wt-page-options-label" for="user-name">
14            <?= I18N::translate('Username') ?>
15        </label>
16        <div class="col-sm-9 wt-page-options-value">
17            <input type="text" class="form-control" id="user-name" name="user_name" value="<?= e($user->userName()) ?>" dir="auto" aria-describedby="username-description" required>
18            <p class="small text-muted" id="username-description">
19                <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?>
20            </p>
21        </div>
22    </div>
23
24    <div class="row form-group">
25        <label class="col-sm-3 col-form-label wt-page-options-label" for="real-name">
26            <?= I18N::translate('Real name') ?>
27        </label>
28        <div class="col-sm-9 wt-page-options-value">
29            <input type="text" class="form-control" id="real-name" name="real_name" value="<?= e($user->realName()) ?>" dir="auto" aria-describedby="real-name-description" required>
30            <p class="small text-muted" id="username-description">
31                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
32            </p>
33        </div>
34    </div>
35
36    <div class="row form-group">
37        <label class="col-sm-3 col-form-label wt-page-options-label" for="gedcom-id">
38            <?= I18N::translate('Individual record') ?>
39        </label>
40        <div class="col-sm-9 wt-page-options-value">
41            <select class="form-control" id="gedcom-id" aria-describedby="gedcom-id-description" disabled>
42                <?php if ($my_individual_record !== null) : ?>
43                    <option value=""><?= $my_individual_record->fullName() ?></option>
44                <?php else : ?>
45                    <option value=""><?= I18N::translateContext('unknown people', 'Unknown') ?></option>
46                <?php endif ?>
47            </select>
48            <p class="small text-muted" id="gedcom-id-description">
49                <?= I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.') ?>
50            </p>
51        </div>
52    </div>
53
54    <div class="row form-group">
55        <label class="col-sm-3 col-form-label wt-page-options-label" for="root-id">
56            <?= I18N::translate('Default individual') ?>
57        </label>
58        <div class="col-sm-9 wt-page-options-value">
59            <?= view('components/select-individual', ['name' => 'root_id', 'id' => 'root-id', 'individual' => $default_individual, 'tree' => $tree]) ?>
60            <p class="small text-muted" id="root-id-description">
61                <?= I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
62            </p>
63        </div>
64    </div>
65
66    <div class="row form-group">
67        <label class="col-sm-3 col-form-label wt-page-options-label" for="password">
68            <?= I18N::translate('Password') ?>
69        </label>
70        <div class="col-sm-9 wt-page-options-value">
71            <input class="form-control" type="password" id="password" name="password" aria-describedby="password-description" autocomplete="new-password">
72            <p class="small text-muted" id="password-description">
73                <?= I18N::translate('Passwords must be at least 8 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?>
74                <br>
75                <?= I18N::translate('Leave the password blank if you want to keep the current password.') ?>
76            </p>
77        </div>
78    </div>
79
80    <div class="row form-group">
81        <label class="col-sm-3 col-form-label wt-page-options-label" for="language">
82            <?= I18N::translate('Language') ?>
83        </label>
84        <div class="col-sm-9 wt-page-options-value">
85            <?= view('components/select', ['name' => 'language', 'selected' => $user->getPreference('language'), 'options' => $installed_languages]) ?>
86        </div>
87    </div>
88
89    <div class="row form-group">
90        <label class="col-sm-3 col-form-label wt-page-options-label" for="timezone">
91            <?= I18N::translate('Time zone') ?>
92        </label>
93        <div class="col-sm-9 wt-page-options-value">
94            <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference('TIMEZONE', 'UTC'), 'options' => $timezones]) ?>
95            <p class="small text-muted" id="timezone-description">
96                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
97            </p>
98        </div>
99    </div>
100
101    <div class="row form-group">
102        <label class="col-sm-3 col-form-label wt-page-options-label" for="email">
103            <?= I18N::translate('Email address') ?>
104        </label>
105        <div class="col-sm-9 wt-page-options-value">
106            <input class="form-control" type="email" id="email" name="email" value="<?= e($user->email()) ?>" aria-describedby="email-description">
107            <p class="small text-muted" id="email-description">
108                <?= 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.') ?>
109            </p>
110        </div>
111    </div>
112
113    <?php if (count($themes) > 2) : ?>
114        <div class="row form-group">
115            <label class="col-sm-3 col-form-label wt-page-options-label" for="theme">
116                <?= I18N::translate('Theme') ?>
117            </label>
118            <div class="col-sm-9 wt-page-options-value">
119                <?= view('components/select', ['name' => 'theme', 'selected' => $user->getPreference('theme'), 'options' => $themes]) ?>
120                <p class="small text-muted" id="theme-description">
121                    <?= /* I18N: Help text for the "Default theme" site configuration setting */
122                    I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
123                </p>
124            </div>
125        </div>
126    <?php endif ?>
127
128    <div class="row form-group">
129        <label class="col-sm-3 col-form-label wt-page-options-label" for="contact-method">
130            <?= I18N::translate('Contact method') ?>
131        </label>
132        <div class="col-sm-9 wt-page-options-value">
133            <?= view('components/select', ['name' => 'contact_method', 'id' => 'contact-method', 'selected' => $user->getPreference('contactmethod'), 'options' => $contact_methods]) ?>
134            <p class="small text-muted" id="contact-method-description">
135            <?= I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.') ?>
136            </p>
137        </div>
138    </div>
139
140    <fieldset class="form-group">
141        <div class="row">
142            <legend class="col-sm-3 col-form-label wt-page-options-label">
143                <?= I18N::translate('Visible online') ?>
144            </legend>
145            <div class="col-sm-9 wt-page-options-value">
146                <?= view('components/checkbox', ['label' => I18N::translate('Visible to other users when online'), 'name' => 'visible_online', 'checked' => (bool) $user->getPreference('visibleonline')]) ?>
147                <p class="small text-muted" id="visible-online-description">
148                    <?= I18N::translate('You can choose whether to appear in the list of users who are currently signed-in.') ?>
149                </p>
150            </div>
151        </div>
152    </fieldset>
153
154    <div class="row form-group">
155        <div class="col-sm-3 wt-page-options-label"></div>
156        <div class="col-sm-9 wt-page-options-value">
157            <input class="btn btn-primary" type="submit" value="<?= I18N::translate('save') ?>">
158        </div>
159    </div>
160</form>
161
162<?php if ($show_delete_option) : ?>
163    <form action="<?= e(route('delete-account', ['ged' => $tree->name()])) ?>" method="post">
164        <?= csrf_field() ?>
165        <div class="row form-group">
166            <div class="col-sm-3 wt-page-options-label"></div>
167            <div class="col-sm-9 wt-page-options-value">
168                <input class="btn btn-danger" type="submit" value="<?= I18N::translate('Delete your account') ?>" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($user->userName())) ?>" onclick="return confirm(this.dataset.confirm);">
169            </div>
170        </div>
171    </form>
172<?php endif ?>
173
174<?php View::push('javascript') ?>
175<script>
176    $('#password').hideShowPassword('infer', true);
177</script>
178<?php View::endpush() ?>
179