Initial commit: Location Management Flask app
This commit is contained in:
20
app/routes/dashboard.py
Normal file
20
app/routes/dashboard.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Dashboard route."""
|
||||
from flask import Blueprint, render_template
|
||||
from flask_login import login_required
|
||||
|
||||
from app.models.board import Board
|
||||
from app.models.workflow import Workflow
|
||||
|
||||
dashboard_bp = Blueprint("dashboard", __name__)
|
||||
|
||||
|
||||
@dashboard_bp.route("/")
|
||||
@login_required
|
||||
def index():
|
||||
boards = Board.query.order_by(Board.name).all()
|
||||
workflows = Workflow.query.filter_by(is_enabled=True).count()
|
||||
return render_template(
|
||||
"dashboard/index.html",
|
||||
boards=boards,
|
||||
active_workflows=workflows,
|
||||
)
|
||||
Reference in New Issue
Block a user