diff --git a/public/assets/css/style.css b/public/assets/css/style.css
index f373a86..92cfe35 100755
--- a/public/assets/css/style.css
+++ b/public/assets/css/style.css
@@ -3300,4 +3300,21 @@ input[type="range"]::-moz-range-track {
overflow-y: auto;
}
+.notif-view-all {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 10px 16px;
+ font-size: 0.82rem;
+ color: var(--accent);
+ text-decoration: none;
+ border-top: 1px solid var(--border-color);
+ transition: background var(--transition);
+}
+
+.notif-view-all:hover {
+ background: var(--bg-hover);
+ color: var(--accent-hover);
+}
+
diff --git a/public/assets/js/main.js b/public/assets/js/main.js
index d678ca3..1f65470 100644
--- a/public/assets/js/main.js
+++ b/public/assets/js/main.js
@@ -48,14 +48,14 @@ function fetchNotifications() {
list.innerHTML = '
Could not load notifications.
';
return;
}
- renderNotifications(d.data || [], d.unread_count || 0);
+ renderNotifications(d.data || [], d.unread_count || 0, d.pagination?.total || 0);
})
.catch(() => {
list.innerHTML = 'Failed to load notifications.
';
});
}
-function renderNotifications(items, unreadCount) {
+function renderNotifications(items, unreadCount, total) {
const list = document.getElementById('notifList');
if (!items.length) {
@@ -85,6 +85,13 @@ function renderNotifications(items, unreadCount) {
+ (n.is_read ? '' : '')
+ '';
});
+
+ if (total > items.length) {
+ html += ''
+ + 'View all notifications (' + total + ' total)'
+ + '';
+ }
+
list.innerHTML = html;
document.getElementById('markAllReadBtn').style.display = unreadCount > 0 ? 'inline-flex' : 'none';
diff --git a/views/layouts/main.php b/views/layouts/main.php
index c3f9f9f..615de9e 100755
--- a/views/layouts/main.php
+++ b/views/layouts/main.php
@@ -169,11 +169,10 @@ if (!isset($user) || $user === null) {
My Account
- Notifications
Audit Log
- Administration
+ Administration