05/24 Enhance functionalities

This commit is contained in:
2026-05-24 18:10:11 -04:00
parent 6605484927
commit fbf271ed71
15 changed files with 593 additions and 30 deletions
+7 -2
View File
@@ -4,7 +4,7 @@ routes/admin_dashboard.py — Admin dashboard: today's completion stats.
import logging
from flask import Blueprint, render_template
from models import get_admin_dashboard_stats
from models import get_admin_dashboard_stats, get_missed_shifts_today
from utils.decorators import admin_required
logger = logging.getLogger("routes.admin_dashboard")
@@ -19,4 +19,9 @@ def dashboard():
except Exception as e:
logger.error(f"Dashboard stats error: {e}")
stats = {"user_stats": [], "total_sites": 0, "total_users": 0, "active_today": 0}
return render_template("admin/dashboard.html", stats=stats)
try:
missed = get_missed_shifts_today()
except Exception as e:
logger.error(f"Missed shifts error: {e}")
missed = []
return render_template("admin/dashboard.html", stats=stats, missed=missed)