aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/notifications_panel.php
blob: 98a04e32771764b904c4f853cf582689e15413bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?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();
            if ($notif == null)
                continue;
            call_template('notification', [
                'title' => $notif->getNotificationTitle(),
                'body' => $notif->getNotificationBody(),
                'imageUrl' => $notif->getNotificationImageUrl(),
                'titleLink' => $notif->getNotificationTitleLink(),
                'imageLink' => $notif->getNotificationImageLink()
            ]);
        }
        ?>
    </div>
</div>