From 6b58bf53e312a67119289b894c5b482d057e5665 Mon Sep 17 00:00:00 2001
From: winter
Date: Sun, 26 Jan 2025 21:53:26 +0000
Subject: make mentions work properly + ui for them
---
templates/note.php | 13 ++++++++++++-
templates/notification.php | 2 +-
templates/reply_form.php | 14 ++++++++++++++
templates/user_mention_pill.php | 31 +++++++++++++++++++++++++++++++
templates/write_note_form.php | 4 ++++
5 files changed, 62 insertions(+), 2 deletions(-)
create mode 100644 templates/user_mention_pill.php
(limited to 'templates')
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 @@
inReplyTo)): ?>
+ mentions) > 0): ?>
+
+
+
+ = sprintf(__('note.info.mentions'), implode(', ', array_map(
+ fn(Actor $m) => '' . $m->displayName . ' ',
+ $note->mentions
+ ))) ?>
+
+
diff --git a/templates/notification.php b/templates/notification.php
index a23a3a6..d787f5e 100644
--- a/templates/notification.php
+++ b/templates/notification.php
@@ -20,7 +20,7 @@
= htmlspecialchars($body) ?>
- _="
+
_="
on load
set title to innerText of previous .title
set body to innerText of previous .body
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 @@
+
+
+ = __('writeNote.mentions.label') ?>
+ mentions, [$note->author]) as $m) {
+ if ($m != $user?->actor) {
+ call_template('user_mention_pill', ['type' => 'user', 'actor' => $m]);
+ }
+ } ?>
+
+
= __('writeReply.action') ?>
diff --git a/templates/user_mention_pill.php b/templates/user_mention_pill.php
new file mode 100644
index 0000000..3b9a018
--- /dev/null
+++ b/templates/user_mention_pill.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ = __('writeNote.mentions.add.action') ?>
+
+
+
+
+
+
+
+
+
+
+ = $actor->displayName ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/write_note_form.php b/templates/write_note_form.php
index 55ed77e..d2dae61 100644
--- a/templates/write_note_form.php
+++ b/templates/write_note_form.php
@@ -17,6 +17,10 @@
= __('writeNote.summary.label') ?>
+
+ = __('writeNote.mentions.label') ?>
+
+
= __('writeNote.scope.label') ?>
--
cgit v1.3