aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/actor_profile_editable.php
blob: 6ff5d8cc6079e4556042dcbcb0e6ae6bb3b7d1b2 (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
<form class="fullProfile" hx-post="/fragment/profile" hx-swap="outerHTML" enctype="multipart/form-data">
    <div class="basicInfo">
        <?php call_template('actor_avatar', ['actor' => $actor]); ?>
        <div>
            <div class="row">
                <div class="column">
                    <label for="profileDisplayName"><?= __('user.profile.displayName') ?></label>
                    <input id="profileDisplayName" name="displayName" type="text" required
                        value="<?= htmlspecialchars($actor->displayName) ?>">
                </div>
                <div class="column">
                    <label for="profilePronouns"><?= __('user.profile.pronouns') ?></label>
                    <input id="profilePronouns" name="pronouns" type="text"
                        value="<?= htmlspecialchars($actor->pronouns) ?>">
                </div>
            </div>
            <div class="handle">@<?= $actor->getFullHandle() ?></div>
            <div class="joinedDate"><?= sprintf(__('user.profile.createdAt'), $actor->created->format('Y-m-d')) ?></div>
        </div>
    </div>

    <div class="row">
        <label for="profileAvatar"><?= __('user.profile.changeAvatar') ?></label>
        <input style="display: inline-block" type="file" id="profileAvatar" name="avatar" accept="image/*">
        <?php call_template('actor_profile_reset_avatar'); ?>
    </div>

    <div class="row">
        <label for="profileBio"><?= __('user.profile.bio') ?></label>
        <textarea id="profileBio" name="bio"><?= htmlspecialchars($actor->bio ?? '') ?></textarea>
    </div>

    <div class="profileActions">
        <button type="button" class="secondary" hx-get="/fragment/actor/<?= $actor->id ?>"
            hx-target="closest .fullProfile" hx-swap="outerHTML">
            <?= __('form.discardChanges') ?>
        </button>
        <button class="primary"><?= __('form.saveChanges') ?></button>
    </div>
</form>