27 lines
726 B
Python
27 lines
726 B
Python
""" The admin controller to manage all of the admin related endpoints
|
|
in the web app
|
|
"""
|
|
|
|
from flask import render_template, Blueprint
|
|
|
|
from controllers.database.user import UserController
|
|
|
|
# Blueprint to append user endpoints to
|
|
blueprint = Blueprint("admin", __name__, url_prefix="/admin")
|
|
|
|
|
|
@blueprint.route('/')
|
|
def main():
|
|
""" Function responsible for delivering the admin page for the site """
|
|
return "Hello, World"
|
|
|
|
|
|
@blueprint.route('/users/')
|
|
def users():
|
|
""" Endpoint responsible for managing a users permissions """
|
|
# Get all users to create admin table on frontend
|
|
db = UserController()
|
|
users = db.read_all()
|
|
|
|
return render_template("index.html", content="admin.html", users=users)
|