diff options
| author | winter | 2025-01-20 17:43:17 +0000 |
|---|---|---|
| committer | winter | 2025-01-20 17:43:17 +0000 |
| commit | 6b78446c1d5b76438d40bbe68aa0397de533e61a (patch) | |
| tree | f2e06477b74e2b380b1922179e3cb16ca1420481 /templates | |
| parent | 55433eeca50ff840cb0b660f8f9de44b2bc6825f (diff) | |
various avatar tweaks and profile above note form
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/actor_avatar.php | 2 | ||||
| -rw-r--r-- | templates/actor_profile_editable.php | 3 | ||||
| -rw-r--r-- | templates/actor_profile_reset_avatar.php | 3 | ||||
| -rw-r--r-- | templates/mobilepane_left.php | 4 | ||||
| -rw-r--r-- | templates/skeleton.php | 2 | ||||
| -rw-r--r-- | templates/write_note_form.php | 9 |
6 files changed, 19 insertions, 4 deletions
diff --git a/templates/actor_avatar.php b/templates/actor_avatar.php index 439072b..16b529b 100644 --- a/templates/actor_avatar.php +++ b/templates/actor_avatar.php @@ -1,5 +1,5 @@ <?php if (isset($actor->avatar)): ?> <img class="avatar" src="<?= $actor->avatar ?>"> <?php else: ?> - <img class="avatar" src="/static/default-avatar.svg"> + <img class="avatar" src="/static/default-avatar.png"> <?php endif; ?>
\ No newline at end of file diff --git a/templates/actor_profile_editable.php b/templates/actor_profile_editable.php index 2c0ef5c..1370e53 100644 --- a/templates/actor_profile_editable.php +++ b/templates/actor_profile_editable.php @@ -14,7 +14,8 @@ <div class="row"> <label for="profileAvatar"><?= __('user.profile.changeAvatar') ?></label> - <input type="file" id="profileAvatar" name="avatar" accept="image/*"> + <input style="display: inline-block" type="file" id="profileAvatar" name="avatar" accept="image/*"> + <?php call_template('actor_profile_reset_avatar'); ?> </div> <div class="row"> diff --git a/templates/actor_profile_reset_avatar.php b/templates/actor_profile_reset_avatar.php new file mode 100644 index 0000000..86a3507 --- /dev/null +++ b/templates/actor_profile_reset_avatar.php @@ -0,0 +1,3 @@ +<button type="button" class="secondary inline" hx-post="/fragment/profile/resetAvatar" <?= ($reset ?? false) ? 'disabled' : '' ?>> + <?= __(($reset ?? false) ? 'user.profile.avatarReset' : 'user.profile.resetAvatar') ?> +</button>
\ No newline at end of file diff --git a/templates/mobilepane_left.php b/templates/mobilepane_left.php index f71279c..daab401 100644 --- a/templates/mobilepane_left.php +++ b/templates/mobilepane_left.php @@ -1,6 +1,8 @@ <?php use Digitigrade\GlobalSettings; +use Digitigrade\Model\UserAccount; +$user = UserAccount::requireByCurrentSession(); $settings = GlobalSettings::getInstance(); ?> <!DOCTYPE html> @@ -29,7 +31,7 @@ $settings = GlobalSettings::getInstance(); ]; call_template('navigation_links', ['links' => $links]); - call_template('write_note_form'); + call_template('write_note_form', ['actor' => $user->actor]); call_template('left_side_navigation'); ?> <p class="versionInfo"><?= sprintf(__('version'), get_version()) ?></p> diff --git a/templates/skeleton.php b/templates/skeleton.php index f7670c0..afe7321 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -59,7 +59,7 @@ $settings = GlobalSettings::getInstance(); <section id="leftPane"> <?php if ($user != null) { - call_template('write_note_form'); + call_template('write_note_form', ['actor' => $user->actor]); } call_template('left_side_navigation'); ?> diff --git a/templates/write_note_form.php b/templates/write_note_form.php index 2d50896..914c48b 100644 --- a/templates/write_note_form.php +++ b/templates/write_note_form.php @@ -1,5 +1,14 @@ <form id="writeNoteForm" action="/todo" method="post" hx-post="/fragment/note" hx-swap="outerHTML" hx-disabled-elt="find button" _="on submit wait 1s then trigger update on #liveTimelineUpdater"> + <div class="row miniProfile"> + <a href="/@/<?= $actor->handle ?>"> + <?php call_template('actor_avatar', ['actor' => $actor]); ?> + </a> + <div class="basicInfo"> + <a class="displayName" href="/@/<?= $actor->handle ?>"><?= $actor->displayName ?></a> + <div class="handle">@<?= $actor->handle ?></div> + </div> + </div> <div class="row"> <label for="noteContent"><?= __('writeNote.label') ?></label> <textarea name="content" id="noteContent" required autocomplete="off"></textarea> |
