summaryrefslogtreecommitdiff
path: root/resources/views/edit-account-page.phtml
blob: d4105a479dd552b30a96d0279775697782e7a420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php

use Fisharebest\Webtrees\Contracts\UserInterface;
use Fisharebest\Webtrees\Http\RequestHandlers\AccountDelete;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Tree;
use Fisharebest\Webtrees\View;

?>

<h2 class="wt-page-title">
    <?= $title ?>
</h2>

<form method="post" class="wt-page-options wt-page-options-my-account">
    <?= csrf_field() ?>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="user-name">
            <?= I18N::translate('Username') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <input type="text" class="form-control" id="user-name" name="user_name" value="<?= e($user->userName()) ?>" dir="auto" aria-describedby="username-description" required>
            <p class="small text-muted" id="username-description">
                <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?>
            </p>
        </div>
    </div>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="real-name">
            <?= I18N::translate('Real name') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <input type="text" class="form-control" id="real-name" name="real_name" value="<?= e($user->realName()) ?>" dir="auto" aria-describedby="real-name-description" required>
            <p class="small text-muted" id="real-name-description">
                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
            </p>
        </div>
    </div>

    <?php if ($tree instanceof Tree) : ?>
        <div class="row form-group">
            <label class="col-sm-3 col-form-label wt-page-options-label" for="gedcom-id">
                <?= I18N::translate('Individual record') ?>
            </label>
            <div class="col-sm-9 wt-page-options-value">
                <select class="form-control" id="gedcom-id" aria-describedby="gedcom-id-description" disabled>
                    <?php if ($my_individual_record !== null) : ?>
                        <option value=""><?= $my_individual_record->fullName() ?></option>
                    <?php else : ?>
                        <option value=""><?= I18N::translateContext('unknown people', 'Unknown') ?></option>
                    <?php endif ?>
                </select>
                <p class="small text-muted" id="gedcom-id-description">
                    <?= I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.') ?>
                </p>
            </div>
        </div>

        <div class="row form-group">
            <label class="col-sm-3 col-form-label wt-page-options-label" for="default-xref">
                <?= I18N::translate('Default individual') ?>
            </label>
            <div class="col-sm-9 wt-page-options-value">
                <?= view('components/select-individual', ['name' => 'default-xref', 'id' => 'default-xref', 'individual' => $default_individual, 'tree' => $tree]) ?>
                <p class="small text-muted" id="default-xref-description">
                    <?= I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
                </p>
            </div>
        </div>
    <?php endif ?>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="password">
            <?= I18N::translate('Password') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <input class="form-control" type="password" id="password" name="password" aria-describedby="password-description" autocomplete="new-password">
            <p class="small text-muted" id="password-description">
                <?= I18N::translate('Passwords must be at least 8 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?>
                <br>
                <?= I18N::translate('Leave the password blank if you want to keep the current password.') ?>
            </p>
        </div>
    </div>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="language">
            <?= I18N::translate('Language') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <?= view('components/select', ['name' => 'language', 'selected' => $user->getPreference(UserInterface::PREF_LANGUAGE), 'options' => $languages]) ?>
        </div>
    </div>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="timezone">
            <?= I18N::translate('Time zone') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference(UserInterface::PREF_TIME_ZONE, 'UTC'), 'options' => $timezones]) ?>
            <p class="small text-muted" id="timezone-description">
                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
            </p>
        </div>
    </div>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="email">
            <?= I18N::translate('Email address') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <input class="form-control" type="email" id="email" name="email" value="<?= e($user->email()) ?>" aria-describedby="email-description">
            <p class="small text-muted" id="email-description">
                <?= 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.') ?>
            </p>
        </div>
    </div>

    <div class="row form-group">
        <label class="col-sm-3 col-form-label wt-page-options-label" for="contact-method">
            <?= I18N::translate('Contact method') ?>
        </label>
        <div class="col-sm-9 wt-page-options-value">
            <?= view('components/select', ['name' => 'contact-method', 'id' => 'contact-method', 'selected' => $user->getPreference(UserInterface::PREF_CONTACT_METHOD), 'options' => $contact_methods]) ?>
            <p class="small text-muted" id="contact-method-description">
            <?= 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.') ?>
            </p>
        </div>
    </div>

    <fieldset class="form-group">
        <div class="row">
            <legend class="col-sm-3 col-form-label wt-page-options-label">
                <?= I18N::translate('Visible online') ?>
            </legend>
            <div class="col-sm-9 wt-page-options-value">
                <?= view('components/checkbox', ['label' => I18N::translate('Visible to other users when online'), 'name' => 'visible-online', 'checked' => (bool) $user->getPreference(UserInterface::PREF_IS_VISIBLE_ONLINE)]) ?>
                <p class="small text-muted" id="visible-online-description">
                    <?= I18N::translate('You can choose whether to appear in the list of users who are currently signed-in.') ?>
                </p>
            </div>
        </div>
    </fieldset>

    <div class="row form-group">
        <div class="col-sm-3 wt-page-options-label"></div>
        <div class="col-sm-9 wt-page-options-value">
            <button type="submit" class="btn btn-primary">
                <?= view('icons/save') ?>
                <?= I18N::translate('save') ?>
            </button>
        </div>
    </div>
</form>

<?php if ($show_delete_option) : ?>
    <div class="row form-group">
        <div class="col-sm-3 wt-page-options-label"></div>
        <div class="col-sm-9 wt-page-options-value">
            <a href="#" class="btn btn-danger" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($user->userName())) ?>" data-post-url="<?= e(route(AccountDelete::class)) ?>">
                <?= view('icons/delete') ?>
                <?= I18N::translate('Delete your account') ?>
            </a>
        </div>
    </div>
<?php endif ?>

<?php View::push('javascript') ?>
<script>
    $('#password').hideShowPassword('infer', true);
</script>
<?php View::endpush() ?>