diff --git a/manager/templates/base.html b/manager/templates/base.html index ed033cf..7f45577 100644 --- a/manager/templates/base.html +++ b/manager/templates/base.html @@ -120,7 +120,7 @@ font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; } - html.collapsed .notif-badge { + html.collapsed .side-nav .notif-badge { position: absolute; top: 5px; right: 8px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; } @@ -336,10 +336,12 @@ const r = await fetch('/api/notifications', { headers: { 'X-Token': t } }); if (!r.ok) return; const d = await r.json(); - const b = document.getElementById('notif-badge'); - if (!b) return; - if (d.unread > 0) { b.textContent = d.unread > 99 ? '99+' : d.unread; b.style.display = 'inline-flex'; } - else { b.style.display = 'none'; } + const label = d.unread > 99 ? '99+' : d.unread; + // update every badge (sidebar nav + homepage card) from the one source + document.querySelectorAll('.notif-badge').forEach(b => { + if (d.unread > 0) { b.textContent = label; b.style.display = 'inline-flex'; } + else { b.style.display = 'none'; } + }); } catch (e) {} } pollNotifications(); diff --git a/manager/templates/home.html b/manager/templates/home.html index f9d2ea1..4cb2320 100644 --- a/manager/templates/home.html +++ b/manager/templates/home.html @@ -75,6 +75,7 @@ 🔔 Notifications + ⚙️