From cd10f94269d7dcdd93df9fcda142a1e5a4441ae9 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 30 Mar 2025 19:00:19 +0100 Subject: implement basic interaction controls --- templates/note/interaction_button.php | 23 +++++++++++++++++++++++ templates/note/note.php | 7 +++---- templates/note/reply_button.php | 5 +++-- templates/note/write_form.php | 30 +++++++++++++++++++++--------- 4 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 templates/note/interaction_button.php (limited to 'templates/note') diff --git a/templates/note/interaction_button.php b/templates/note/interaction_button.php new file mode 100644 index 0000000..bfcbd85 --- /dev/null +++ b/templates/note/interaction_button.php @@ -0,0 +1,23 @@ + __("note.action.like$forbidden"), + 'dislike' => __("note.action.dislike$forbidden"), + 'reshare' => __("note.action.reshare$forbidden") +}; +$icon = match ($action) { + 'like' => $active ? 'favorite' : 'favorite-outline', + 'dislike' => $active ? 'heart-broken' : 'heart-broken-outline', + 'reshare' => $active ? 'repeat-on' : 'repeat' +}; +$id = "interactButton-$action-$note->id"; +?> +