aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/actor_profile_editable.php
diff options
context:
space:
mode:
authorwinter2025-01-18 16:01:25 +0000
committerwinter2025-01-18 16:01:25 +0000
commitc0e65d0446f928b30eecc858c5cf9a8eb1a364c1 (patch)
treebb22cd9b3e6b4a05f9bf2b41393f3aaa9048f4bb /templates/actor_profile_editable.php
parentba61c6435b668375a411716f3a35447aa38b03a4 (diff)
implement profile editing
Diffstat (limited to 'templates/actor_profile_editable.php')
-rw-r--r--templates/actor_profile_editable.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/templates/actor_profile_editable.php b/templates/actor_profile_editable.php
new file mode 100644
index 0000000..2c0ef5c
--- /dev/null
+++ b/templates/actor_profile_editable.php
@@ -0,0 +1,32 @@
+<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">
+ <label for="profileDisplayName"><?= __('user.profile.displayName') ?></label>
+ <input id="profileDisplayName" name="displayName" type="text" required
+ value="<?= $actor->displayName ?>">
+ </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 type="file" id="profileAvatar" name="avatar" accept="image/*">
+ </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> \ No newline at end of file