mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2026-06-03 22:48:20 -06:00
feat: add summary stats bar to admin page
Displays total entries, this week, this month, and newsletter opt-in count and percentage at the top of the admin view. Week/month boundaries are computed in America/Denver time and converted to UTC for SQLite comparison, handling DST correctly.
This commit is contained in:
+12
-2
@@ -21,10 +21,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="bg-light">
|
<body class="bg-light">
|
||||||
<div class="container py-4">
|
<div class="container py-4">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
<h1 class="h3 mb-0">Guestbook Admin</h1>
|
<h1 class="h3 mb-0">Guestbook Admin</h1>
|
||||||
<div class="d-flex align-items-center gap-3">
|
<div class="d-flex align-items-center gap-3">
|
||||||
<span class="text-muted">{{ current_user.username }} · {{ total }} entries</span>
|
<span class="text-muted">{{ current_user.username }}</span>
|
||||||
|
{% if current_user.role != 'viewer' %}
|
||||||
|
<a href="{{ url_for('admin_export_csv') }}" class="btn btn-outline-success btn-sm">Export CSV</a>
|
||||||
|
{% endif %}
|
||||||
{% if current_user.role == 'superadmin' %}
|
{% if current_user.role == 'superadmin' %}
|
||||||
<a href="{{ url_for('admin_users') }}" class="btn btn-outline-secondary btn-sm">Manage Users</a>
|
<a href="{{ url_for('admin_users') }}" class="btn btn-outline-secondary btn-sm">Manage Users</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -32,6 +35,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex flex-wrap gap-2 mb-3 align-items-center">
|
||||||
|
<span class="badge bg-primary" style="font-size:0.9rem;">{{ stats.total }} total</span>
|
||||||
|
<span class="badge bg-secondary">{{ stats.week }} this week</span>
|
||||||
|
<span class="badge bg-secondary">{{ stats.month }} this month</span>
|
||||||
|
<span class="badge bg-success">{{ stats.newsletter_count }} newsletter ({{ stats.newsletter_pct }}%)</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Mobile card list (phones) -->
|
<!-- Mobile card list (phones) -->
|
||||||
<div class="d-md-none">
|
<div class="d-md-none">
|
||||||
{% for g in guests %}
|
{% for g in guests %}
|
||||||
|
|||||||
Reference in New Issue
Block a user