feat(profiles): add pending count to profile card stats
This commit is contained in:
@@ -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"),
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
<span class="stat-value">{{ e.total }}</span>
|
||||
<span class="stat-label">{{ 'profiles.total'|t(user.language) }}</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="stat-value badge-pending-text">{{ e.pending }}</span>
|
||||
<span class="stat-label">{{ 'status.pending'|t(user.language) }}</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="stat-value badge-sent-text">{{ e.sent }}</span>
|
||||
<span class="stat-label">{{ 'dash.sent'|t(user.language) }}</span>
|
||||
|
||||
Reference in New Issue
Block a user