From 7da337cc4d5a678a9b23a8c604a7cc3eab44ebc1 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Tue, 28 Jul 2026 07:37:44 +0800 Subject: [PATCH] feat(profiles): add pending count to profile card stats --- app/routers/web.py | 1 + app/static/style.css | 1 + app/templates/profiles.html | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/app/routers/web.py b/app/routers/web.py index 6ed4f36..e016987 100644 --- a/app/routers/web.py +++ b/app/routers/web.py @@ -644,6 +644,7 @@ def profile_list(request: Request, user: User = Depends(get_current_user_web), d cards = db.query(Postcard).filter(Postcard.profile_id == p.id).all() extras[p.id] = { "total": len(cards), + "pending": sum(1 for c in cards if c.status == "pending"), "sent": sum(1 for c in cards if c.status == "sent"), "delivered": sum(1 for c in cards if c.status == "delivered"), "received": sum(1 for c in cards if c.status == "received"), diff --git a/app/static/style.css b/app/static/style.css index dc38a81..4666e7c 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -229,6 +229,7 @@ code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; font-si .stat-value { font-size: 1.1rem; font-weight: 700; } .stat-label { font-size: .75rem; color: var(--text-muted); } .badge-sent-text { color: var(--sent); } +.badge-pending-text { color: var(--primary); } .badge-delivered-text { color: var(--delivered); } .badge-received-text { color: var(--received); } .profile-card-footer { display: flex; align-items: center; justify-content: space-between; } diff --git a/app/templates/profiles.html b/app/templates/profiles.html index 43045d2..c833252 100644 --- a/app/templates/profiles.html +++ b/app/templates/profiles.html @@ -34,6 +34,10 @@ {{ e.total }} {{ 'profiles.total'|t(user.language) }} +
+ {{ e.pending }} + {{ 'status.pending'|t(user.language) }} +
{{ e.sent }} {{ 'dash.sent'|t(user.language) }}