From 5fdf0f130bd885134d26ee7148b61af9c733bc01 Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Fri, 20 Mar 2026 15:01:28 +0100 Subject: [PATCH] Auto-commit local changes before build (2026-03-20 15:01:28) --- .../backupchecks/src/backend/app/__init__.py | 15 +++++++++++++++ docs/changelog-claude.md | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/containers/backupchecks/src/backend/app/__init__.py b/containers/backupchecks/src/backend/app/__init__.py index ca9b7ed..9b2910a 100644 --- a/containers/backupchecks/src/backend/app/__init__.py +++ b/containers/backupchecks/src/backend/app/__init__.py @@ -200,6 +200,21 @@ def create_app(): return None + @app.context_processor + def inject_inbox_count(): + """Inject inbox_count into every template so the sidebar badge is always visible.""" + try: + from flask_login import current_user as _cu + if not _cu or not _cu.is_authenticated: + return {} + from .models import MailMessage + q = MailMessage.query + if hasattr(MailMessage, "location"): + q = q.filter(MailMessage.location == "inbox") + return {"inbox_count": int(q.count() or 0)} + except Exception: + return {} + @app.get("/health") def health(): return {"status": "ok"} diff --git a/docs/changelog-claude.md b/docs/changelog-claude.md index b3391f9..5c8de9e 100644 --- a/docs/changelog-claude.md +++ b/docs/changelog-claude.md @@ -2,6 +2,13 @@ This file documents all changes made to this project via Claude Code. +## [2026-03-20] (7) + +### Fixed +- Inbox badge in sidebar now visible on all pages (not only the dashboard): + - Added a Flask `context_processor` in `__init__.py` that injects `inbox_count` into every template for authenticated users + - Previously `inbox_count` was only passed in the dashboard route, causing the badge to disappear on all other pages + ## [2026-03-20] (6) ### Fixed