broke out notifications into ‘locations’ in data

This commit is contained in:
Andy Miller
2019-02-08 17:58:13 -07:00
parent ecde5e79a7
commit 5fc89d2bdd
3 changed files with 24 additions and 12 deletions

View File

@@ -831,11 +831,15 @@ class AdminController extends AdminBaseController
}
// do we need to force a reload
$refresh = (bool) ($this->data['refresh'] ?? false);
$refresh = (bool) ($this->data['refresh'] ?? true);
try {
$notifications = $this->admin->getNotifications($refresh);
$notification_data = $this->grav['twig']->processTemplate('partials/notification-block.html.twig', ['notifications' => $notifications]);
foreach ($notifications as $type => $type_notifications) {
$notification_data[$type] = $this->grav['twig']->processTemplate('partials/notification-block.html.twig', ['notifications' => $type_notifications]);
}
$json_response = [
'status' => 'success',