aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/actor_profile.php10
-rw-r--r--templates/actor_profile_editable.php32
2 files changed, 40 insertions, 2 deletions
diff --git a/templates/actor_profile.php b/templates/actor_profile.php
index 0dc3ccd..46ee273 100644
--- a/templates/actor_profile.php
+++ b/templates/actor_profile.php
@@ -25,13 +25,13 @@ $user = UserAccount::findByCurrentSession();
</div>
</div>
<?php if (isset($actor->bio) && $actor->bio != '') { ?>
- <p class="bio"><?= $actor->bio ?></p>
+ <pre class="bio"><?= $actor->bio ?></pre>
<?php } else {
call_template('placeholder_text', ['message' => __('user.profile.bio.placeholder')]);
} ?>
<?php if (isset($user) && $actor->id != $user->actor->id): ?>
- <div class="followInfo">
+ <div class="profileActions">
<?php if ($actor->followsPending($user->actor))
call_template('actor_profile_pending_follow', ['subject' => $actor, 'object' => $user->actor]); ?>
<?php if ($actor->follows($user->actor)): ?>
@@ -39,5 +39,11 @@ $user = UserAccount::findByCurrentSession();
<?php endif; ?>
<?php call_template('actor_profile_follow_button', ['actor' => $actor, 'user' => $user]); ?>
</div>
+ <?php elseif ($actor->id == $user->actor->id): ?>
+ <div class="profileActions">
+ <button class="primary" hx-get="/fragment/profile" hx-target="closest .fullProfile" hx-swap="outerHTML">
+ <?= __('form.edit') ?>
+ </button>
+ </div>
<?php endif; ?>
</div> \ No newline at end of file
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