bump project

This commit is contained in:
2026-05-01 21:24:21 +03:30
parent dc4b1a1400
commit 139b3e26da
83 changed files with 2455 additions and 18349 deletions

1
app/main/__init__.py Normal file
View File

@@ -0,0 +1 @@

28
app/main/routes.py Normal file
View File

@@ -0,0 +1,28 @@
from __future__ import annotations
from flask import Blueprint, redirect, render_template, url_for
from flask_login import current_user, login_required
from app.models import Account, AttendanceEvent, Person
bp = Blueprint("main", __name__)
@bp.get("/")
def index():
if current_user.is_authenticated:
return redirect(url_for("main.dashboard"))
return redirect(url_for("auth.login"))
@bp.get("/dashboard")
@login_required
def dashboard():
stats = {
"people": Person.query.count(),
"active_people": Person.query.filter_by(active=True).count(),
"events": AttendanceEvent.query.count(),
"accounts": Account.query.count(),
}
latest_events = AttendanceEvent.query.order_by(AttendanceEvent.occurred_at.desc()).limit(8).all()
return render_template("dashboard.html", stats=stats, latest_events=latest_events)