diff options
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 |
