aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
diff options
context:
space:
mode:
authorwinter2025-01-26 21:53:26 +0000
committerwinter2025-01-26 21:53:26 +0000
commit6b58bf53e312a67119289b894c5b482d057e5665 (patch)
treefef168089a75d73353af1a79456e711c72385ca3 /templates/note.php
parent7d3f35b1895dd3fe08af0f5fe403ff339acd2456 (diff)
make mentions work properly + ui for them
Diffstat (limited to 'templates/note.php')
-rw-r--r--templates/note.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/templates/note.php b/templates/note.php
index d892656..e5c2942 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -1,4 +1,5 @@
<?php
+use Digitigrade\Model\Actor;
use Digitigrade\Model\InteractionKind;
use Digitigrade\Model\NotePrivacyScope;
use Digitigrade\Model\UserAccount;
@@ -47,12 +48,22 @@ if ($user != null) {
<?php if (isset($note->inReplyTo)): ?>
<div class="replyInfo">
+ <span class="material-symbols reply inlineIcon"></span>
<a href="/@/<?= $note->inReplyTo->author->getFullHandle() ?>/note/<?= $note->inReplyTo->id ?>">
- <span class="material-symbols reply inlineIcon"></span>
<?= sprintf(__('note.info.replyTo'),
'<b>' . htmlspecialchars($note->inReplyTo->author->displayName)) . '</b>' ?>
</a>
</div>
+ <?php elseif (count($note->mentions) > 0): ?>
+ <div class="replyInfo">
+ <span class="material-symbols alternate-email inlineIcon"></span>
+ <span>
+ <?= sprintf(__('note.info.mentions'), implode(', ', array_map(
+ fn(Actor $m) => '<b><a href="/@/' . $m->getFullHandle() . '">' . $m->displayName . '</a></b>',
+ $note->mentions
+ ))) ?>
+ </span>
+ </div>
<?php endif; ?>
<div class="content">