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