From 8c6dad8c48d5d730b102d9de0079fee9752b0d35 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 19 Jan 2025 22:17:12 +0000 Subject: implement notifications --- templates/live_notifications_updater.php | 4 ++ templates/notification.php | 23 ++++++++++ templates/notifications_panel.php | 26 ++++++++++++ templates/skeleton.php | 72 ++++++++++++++++++-------------- templates/write_note_form.php | 4 +- 5 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 templates/live_notifications_updater.php create mode 100644 templates/notification.php create mode 100644 templates/notifications_panel.php (limited to 'templates') diff --git a/templates/live_notifications_updater.php b/templates/live_notifications_updater.php new file mode 100644 index 0000000..bbf31b4 --- /dev/null +++ b/templates/live_notifications_updater.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/templates/notification.php b/templates/notification.php new file mode 100644 index 0000000..a010ff9 --- /dev/null +++ b/templates/notification.php @@ -0,0 +1,23 @@ +
+
+ + + + + + + + + +
+
+ + + + + + + + +
+
\ No newline at end of file diff --git a/templates/notifications_panel.php b/templates/notifications_panel.php new file mode 100644 index 0000000..3ca8faf --- /dev/null +++ b/templates/notifications_panel.php @@ -0,0 +1,26 @@ + +
+

+ new \DateTimeImmutable()]); ?> +
+ toNotifyable(); + call_template('notification', [ + 'title' => $notif->getNotificationTitle(), + 'body' => $notif->getNotificationBody(), + 'imageUrl' => $notif->getNotificationImageUrl(), + 'titleLink' => $notif->getNotificationTitleLink(), + 'imageLink' => $notif->getNotificationImageLink() + ]); + } + ?> +
+
\ No newline at end of file diff --git a/templates/skeleton.php b/templates/skeleton.php index 9e27386..3b2a963 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -46,39 +46,47 @@ $settings = GlobalSettings::getInstance();
-
- '/followrequests', - 'icon' => 'person_add', - 'label' => __('navigation.followRequests'), - 'unreadCount' => FollowRelation::countWhere("object = ? AND status = 'pending'", [$user->actor->id]) - ]]; - if ($user->isAdmin) { - $links[] = ['href' => '/admin/settings/instance', 'icon' => 'settings', 'label' => __('navigation.instanceSettings')]; +
+
+ '/followrequests', + 'icon' => 'person_add', + 'label' => __('navigation.followRequests'), + 'unreadCount' => FollowRelation::countWhere("object = ? AND status = 'pending'", [$user->actor->id]) + ]]; + if ($user->isAdmin) { + $links[] = ['href' => '/admin/settings/instance', 'icon' => 'settings', 'label' => __('navigation.instanceSettings')]; + } + $links[] = [ + 'href' => '/logout', + 'icon' => 'logout', + 'label' => __('navigation.logout'), + 'confirmation' => __('navigation.logout.confirmation') + ]; + call_template('side_navigation', ['links' => $links]); } - $links[] = [ - 'href' => '/logout', - 'icon' => 'logout', - 'label' => __('navigation.logout'), - 'confirmation' => __('navigation.logout.confirmation') - ]; - call_template('side_navigation', ['links' => $links]); - } - ?> -

-
-
- -

- - -
-
- -
+ ?> +

+
+ +
+
+ +

+ + +
+
+
+
+ $user]); + } ?> +
+
diff --git a/templates/write_note_form.php b/templates/write_note_form.php index b74de69..2d50896 100644 --- a/templates/write_note_form.php +++ b/templates/write_note_form.php @@ -1,5 +1,5 @@ -
+
-- cgit v1.3