Numberplate shows on Dash

Added logs.html for the logs page
Changed dashboard.html so the numberplates show on the dashboard
Moved models.py to to the dashboard folder
This commit is contained in:
DaanoGames
2025-05-22 13:16:30 +02:00
parent c9eb18fd0b
commit 2f7a499c91
7 changed files with 58 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
from flask import Blueprint, render_template
from flask_login import login_required
from application.models import AllowedPlate, LoggedItem
from application.dashboard.models import AllowedPlate, LoggedItem
from application import db, app
from application.dashboard.forms import npForm
@@ -11,8 +11,11 @@ dash_blueprint = Blueprint("dash", __name__, template_folder="templates")
@dash_blueprint.route('/dashboard')
#@login_required
def dashboard():
form = LoggedItem.query.all()
return render_template("dashboard.html", form=form)
#print("test123")
#with app.app_context():
Plates = AllowedPlate.query.all()
print(Plates)
return render_template("dashboard.html", AllowedPlates = Plates)
@dash_blueprint.route('/add', methods=['GET', 'POST'])
#@login_required
@@ -30,4 +33,10 @@ def add():
return render_template("add.html", form=form)
return render_template("add.html", form=form)
@dash_blueprint.route('/logs', methods=['GET', 'POST'])
#@login_required
def logs():
form = LoggedItem.query.all()
return render_template("logs.html", form=form)