make all this have a login page, use ldap, put a logo on, moved some upstream stuff to static/ -- need to do more here to be consistent with bootstrap 5, but for another day

This commit is contained in:
2022-06-19 22:45:54 +10:00
parent 4725f006bc
commit c29f73f8ab
14 changed files with 274 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
from wtforms import SubmitField, StringField, HiddenField, SelectField, validators
from flask import request, render_template, redirect
from flask_wtf import FlaskForm
from flask_login import login_required, current_user
from main import db, app, ma
from sqlalchemy import Sequence
from sqlalchemy.exc import SQLAlchemyError
@@ -37,6 +38,7 @@ class CovertypeForm(FlaskForm):
# /covertypes -> GET only -> prints out list of all covertypes
################################################################################
@app.route("/covertypes", methods=["GET"])
@login_required
def covertypes():
objects = Covertype.query.order_by('id').all()
return render_template("show_id_name.html", objects=objects, page_title='Show All Covertypes', url_base='covertype', alert=st.GetAlert(), message=st.GetMessage() )
@@ -45,6 +47,7 @@ def covertypes():
# /covertype -> GET/POST -> creates a new covertype type and when created, takes you back to /covertypes
################################################################################
@app.route("/covertype", methods=["GET", "POST"])
@login_required
def new_covertype():
form = CovertypeForm(request.form)
page_title='Create new Covertype'
@@ -67,6 +70,7 @@ def new_covertype():
# /covertype/<id> -> GET/POST(save or delete) -> shows/edits/delets a single covertype
################################################################################
@app.route("/covertype/<id>", methods=["GET", "POST"])
@login_required
def covertype(id):
### DDP: should this be request.form or request.values?
form = CovertypeForm(request.form)