fix: remove notifications link from user menu, add view-all button to notification dropdown, fix admin link
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,14 +48,14 @@ function fetchNotifications() {
|
||||
list.innerHTML = '<div style="padding:40px 20px;text-align:center;color:var(--text-muted)">Could not load notifications.</div>';
|
||||
return;
|
||||
}
|
||||
renderNotifications(d.data || [], d.unread_count || 0);
|
||||
renderNotifications(d.data || [], d.unread_count || 0, d.pagination?.total || 0);
|
||||
})
|
||||
.catch(() => {
|
||||
list.innerHTML = '<div style="padding:40px 20px;text-align:center;color:var(--danger)">Failed to load notifications.</div>';
|
||||
});
|
||||
}
|
||||
|
||||
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 ? '' : '<div class="notif-dot"></div>')
|
||||
+ '</div>';
|
||||
});
|
||||
|
||||
if (total > items.length) {
|
||||
html += '<a href="/notifications" class="notif-view-all">'
|
||||
+ 'View all notifications (' + total + ' total)'
|
||||
+ '</a>';
|
||||
}
|
||||
|
||||
list.innerHTML = html;
|
||||
|
||||
document.getElementById('markAllReadBtn').style.display = unreadCount > 0 ? 'inline-flex' : 'none';
|
||||
|
||||
Reference in New Issue
Block a user