aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/reply_form.php
diff options
context:
space:
mode:
authorwinter2025-01-26 21:53:26 +0000
committerwinter2025-01-26 21:53:26 +0000
commit6b58bf53e312a67119289b894c5b482d057e5665 (patch)
treefef168089a75d73353af1a79456e711c72385ca3 /templates/reply_form.php
parent7d3f35b1895dd3fe08af0f5fe403ff339acd2456 (diff)
make mentions work properly + ui for them
Diffstat (limited to 'templates/reply_form.php')
-rw-r--r--templates/reply_form.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/reply_form.php b/templates/reply_form.php
index 3434472..57a0dd0 100644
--- a/templates/reply_form.php
+++ b/templates/reply_form.php
@@ -1,3 +1,8 @@
+<?php
+use Digitigrade\Model\UserAccount;
+
+$user = UserAccount::findByCurrentSession();
+?>
<form class="noteReplyForm" id="replyForm-<?= $note->id ?>"
_="on submit send toggle to previous <button.reply/> then wait 1s then trigger update on #liveTimelineUpdater on toggle or submit toggle @hidden"
hidden hx-post="/fragment/note/<?= $note->id ?>/reply" hx-disabled-elt="find button" hx-swap="outerHTML">
@@ -11,6 +16,15 @@
value="<?= $note->summary ? "re: $note->summary" : '' ?>">
</div>
<div class="row">
+ <label class="standalone"><?= __('writeNote.mentions.label') ?></label>
+ <?php foreach (array_merge($note->mentions, [$note->author]) as $m) {
+ if ($m != $user?->actor) {
+ call_template('user_mention_pill', ['type' => 'user', 'actor' => $m]);
+ }
+ } ?>
+ <?php call_template('user_mention_pill'); ?>
+ </div>
+ <div class="row">
<button class="primary"><?= __('writeReply.action') ?></button>
</div>
</form> \ No newline at end of file