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:
@@ -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 PublisherForm(FlaskForm):
|
||||
# /publishers -> GET only -> prints out list of all publishers
|
||||
################################################################################
|
||||
@app.route("/publishers", methods=["GET"])
|
||||
@login_required
|
||||
def publishers():
|
||||
objects = Publisher.query.order_by('id').all()
|
||||
return render_template("show_id_name.html", objects=objects, page_title='Show All Publishers', url_base='publisher', alert=st.GetAlert(), message=st.GetMessage() )
|
||||
@@ -45,6 +47,7 @@ def publishers():
|
||||
# /publisher -> GET/POST -> creates a new publisher type and when created, takes you back to /publishers
|
||||
################################################################################
|
||||
@app.route("/publisher", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def new_publisher():
|
||||
form = PublisherForm(request.form)
|
||||
page_title='Create new Publisher'
|
||||
@@ -66,6 +69,7 @@ def new_publisher():
|
||||
# /publisher/<id> -> GET/POST(save or delete) -> shows/edits/delets a single publisher
|
||||
################################################################################
|
||||
@app.route("/publisher/<id>", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def publisher(id):
|
||||
### DDP: should this be request.form or request.values?
|
||||
form = PublisherForm(request.form)
|
||||
|
||||
Reference in New Issue
Block a user