From 25b748f04911262826d0a0bc9609e03ee47c3232 Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 14 Jan 2025 18:13:57 +0000 Subject: add interaction counters --- templates/note.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'templates/note.php') diff --git a/templates/note.php b/templates/note.php index 1fb03a9..0a19475 100644 --- a/templates/note.php +++ b/templates/note.php @@ -9,7 +9,7 @@ if ($user != null) { $interKinds = array_map(fn($inter) => $inter->kind, $interactions); } ?> -
+
$note->author]); ?> @@ -41,13 +41,15 @@ if ($user != null) {
$action, 'note' => $note, - 'active' => in_array(InteractionKind::from($action), $interKinds) + 'active' => in_array($kind, $interKinds), + 'count' => $note->countInteractionsOfKind($kind) ]); } - call_template('reply_button', ['note' => $note]); + call_template('reply_button', ['note' => $note, 'count' => $note->countReplies()]); ?>
$note]); ?> -- cgit v1.3