diff options
| author | winter | 2025-01-19 22:17:12 +0000 |
|---|---|---|
| committer | winter | 2025-01-19 22:17:12 +0000 |
| commit | 8c6dad8c48d5d730b102d9de0079fee9752b0d35 (patch) | |
| tree | 2cfe07a8c7958f78c767fd0d1444c3f8fef70511 /templates/notifications_panel.php | |
| parent | 2d9bd87fb1c565ee161f93219ce2533e8dbffe06 (diff) | |
implement notifications
Diffstat (limited to 'templates/notifications_panel.php')
| -rw-r--r-- | templates/notifications_panel.php | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ +<?php +use Digitigrade\Model\Notification; + +$notifications = Notification::findAllForUser($user, 50); +?> +<div id="notificationsPanel"> + <h2><?= __('notifications.heading') ?></h2> + <?php call_template('live_notifications_updater', ['since' => new \DateTimeImmutable()]); ?> + <div class="items"> + <?php + if (count($notifications) <= 0) { + call_template('placeholder_text'); + } + foreach ($notifications as $notif) { + $notif = $notif->toNotifyable(); + call_template('notification', [ + 'title' => $notif->getNotificationTitle(), + 'body' => $notif->getNotificationBody(), + 'imageUrl' => $notif->getNotificationImageUrl(), + 'titleLink' => $notif->getNotificationTitleLink(), + 'imageLink' => $notif->getNotificationImageLink() + ]); + } + ?> + </div> +</div>
\ No newline at end of file |
