diff options
Diffstat (limited to 'templates/actor')
| -rw-r--r-- | templates/actor/profile.php | 8 | ||||
| -rw-r--r-- | templates/actor/profile_poke_form.php | 24 |
2 files changed, 32 insertions, 0 deletions
diff --git a/templates/actor/profile.php b/templates/actor/profile.php index be27c86..1e8e51c 100644 --- a/templates/actor/profile.php +++ b/templates/actor/profile.php @@ -1,4 +1,6 @@ <?php +/** @var \Digitigrade\Model\Actor $actor */ + use Digitigrade\Model\UserAccount; use Digitigrade\UserSettings; @@ -72,6 +74,12 @@ $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_poke_form.php b/templates/actor/profile_poke_form.php new file mode 100644 index 0000000..7dcc360 --- /dev/null +++ b/templates/actor/profile_poke_form.php @@ -0,0 +1,24 @@ +<?php /** @var \Digitigrade\Model\Actor $actor */ ?> +<form class="nobackground pokeForm" hx-post="/fragment/actor/<?= $actor->id ?>/poke" hx-disabled-elt="find button"> + <div class="row"> + <div class="column"> + <select id="pokeVerb-<?= $actor->id ?>" name="verb"> + <?php foreach (['poke', 'bite', 'punch', 'kick', 'wave', 'yell', 'hug', 'kiss', 'pet'] as $verb): ?> + <option value="<?= $verb ?>"><?= __("user.profile.poke.verb.$verb") ?></option> + <?php endforeach; ?> + </select> + </div> + <div class="column"> + <label for="pokeUrgent-<?= $actor->id ?>"><?= __('user.profile.poke.urgent.label') ?></label> + <input type="checkbox" id="pokeUrgent-<?= $actor->id ?>" name="urgent"> + </div> + <div class="column"> + <button type="submit" class="primary"><?= __('user.profile.poke.action') ?></button> + </div> + <div class="column"> + <?php if ($poked ?? false): ?> + <span class="temporaryIndicator"><?= __('user.profile.poke.success') ?></span> + <?php endif; ?> + </div> + </div> +</form>
\ No newline at end of file |
