diff options
| author | winter | 2025-03-30 19:30:30 +0100 |
|---|---|---|
| committer | winter | 2025-03-30 19:30:30 +0100 |
| commit | 6ce663dc0959ad0a776bbd8861450346ae0c1966 (patch) | |
| tree | 78120d4f0f4deaf280ffc4752f45f7cb3c72d9a9 | |
| parent | b5ec7311ef03232099dd3f8b30298738e1d0937e (diff) | |
relocate poke form to under profile card
| -rw-r--r-- | static/form.css | 12 | ||||
| -rw-r--r-- | static/profile.css | 17 | ||||
| -rw-r--r-- | templates/actor/profile.php | 6 | ||||
| -rw-r--r-- | templates/actor/profile_page.php | 5 | ||||
| -rw-r--r-- | templates/actor/profile_poke_form.php | 7 |
5 files changed, 17 insertions, 30 deletions
diff --git a/static/form.css b/static/form.css index ef8956a..fea9697 100644 --- a/static/form.css +++ b/static/form.css @@ -193,11 +193,15 @@ form:not(.nopanel) { } &.pokeForm { - border-start-start-radius: 0; - margin: 0; - padding: var(--spacing-single) var(--spacing-double); + max-width: 100%; .row:has(> .column) { - grid-auto-columns: max-content; + grid-auto-columns: auto max-content max-content; + } + select, + input { + width: 100%; + margin-bottom: 0 !important; + margin-top: 0 !important; } } diff --git a/static/profile.css b/static/profile.css index ed92b44..a46a9a3 100644 --- a/static/profile.css +++ b/static/profile.css @@ -55,23 +55,6 @@ gap: var(--spacing-double); } } - - details > summary { - background: var(--clr-secondary); - color: var(--clr-foreground-on-secondary); - font-weight: bold; - cursor: pointer; - border-radius: var(--border-radius); - padding: var(--spacing-single) var(--spacing-double); - width: max-content; - - &::before { - color: var(--clr-foreground-on-secondary); - } - } - details[open]:has(.pokeForm) > summary { - border-radius: var(--border-radius) var(--border-radius) 0 0; - } } form.fullProfile { diff --git a/templates/actor/profile.php b/templates/actor/profile.php index 1e8e51c..8339fa2 100644 --- a/templates/actor/profile.php +++ b/templates/actor/profile.php @@ -74,12 +74,6 @@ $actorUser = UserAccount::findByLinkedActor($actor); <?php endif; ?> <?php call_template('actor/profile_follow_button', ['actor' => $actor, 'user' => $user]); ?> </div> - <?php if ($actor->isPokeable()): ?> - <details> - <summary><?= __('user.profile.poke') ?></summary> - <?php call_template('actor/profile_poke_form', ['actor' => $actor]); ?> - </details> - <?php endif; ?> <?php elseif ($actor->id == $user->actor->id): ?> <div class="profileActions"> <button class="primary" hx-get="/fragment/profile" hx-target="closest .fullProfile" hx-swap="outerHTML"> diff --git a/templates/actor/profile_page.php b/templates/actor/profile_page.php index 9c11dd6..7ae8d09 100644 --- a/templates/actor/profile_page.php +++ b/templates/actor/profile_page.php @@ -33,6 +33,11 @@ call_template('skeleton', [ $user = UserAccount::findByCurrentSession(); call_template('actor/profile', ['actor' => $actor]); + + if (isset($user) && $actor->isPokeable() && $actor != $user->actor) { + call_template('actor/profile_poke_form', ['actor' => $actor]); + } + echo '<hr>'; $notes = Note::findAllWithAuthor($actor, 20); if (count($notes) == 0) { diff --git a/templates/actor/profile_poke_form.php b/templates/actor/profile_poke_form.php index 28d89d3..5f53f11 100644 --- a/templates/actor/profile_poke_form.php +++ b/templates/actor/profile_poke_form.php @@ -5,15 +5,16 @@ <form class="pokeForm" hx-post="/fragment/actor/<?= $actor->id ?>/poke" hx-disabled-elt="find button" hx-target="this" hx-swap="outerHTML"> <div class="row"> - <select id="pokeVerb-<?= $actor->id ?>" name="verb"> + <label class="standalone"><?= __('user.profile.poke') ?></label> + </div> + <div class="row"> + <select class="column" id="pokeVerb-<?= $actor->id ?>" name="verb"> <?php foreach (['poke', 'bite', 'punch', 'kick', 'wave', 'yell', 'hug', 'kiss', 'pet'] as $verb): ?> <option value="<?= $verb ?>" <?= ($selectedVerb ?? null) == $verb ? 'selected' : '' ?>> <?= __("user.profile.poke.verb.$verb") ?> </option> <?php endforeach; ?> </select> - </div> - <div class="row"> <div class="column"> <button type="submit" class="primary"><?= __('user.profile.poke.action') ?></button> </div> |
