From 7ebeb10cda142273b7598541aaf50724d02c4984 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Tue, 6 Feb 2024 19:30:08 +0000 Subject: [PATCH] Changed urls to all use 'url_for' syntax --- controllers/web/stats.py | 8 ++------ templates/header.html | 18 +++++++++--------- templates/login.html | 2 +- templates/new_product.html | 2 +- templates/signup.html | 2 +- templates/stats.html | 9 --------- 6 files changed, 14 insertions(+), 27 deletions(-) diff --git a/controllers/web/stats.py b/controllers/web/stats.py index 6fa9771..9d12f0c 100644 --- a/controllers/web/stats.py +++ b/controllers/web/stats.py @@ -1,21 +1,17 @@ """ The user controller to manage all of the stats related endpoints in the web app """ -import json -import random from flask import Blueprint -from flask import render_template, redirect, request, session, flash +from flask import render_template, request from controllers.database.stats import StatsController -from models.stats import Stats -from models.users.user import User # Blueprint to append user endpoints to blueprint = Blueprint("stats", __name__, url_prefix='/stats') @blueprint.route('/') -def stats_index(): +def index(): """ Main page to view all of the statistics for the site """ db = StatsController() data = db.read() diff --git a/templates/header.html b/templates/header.html index 21d686c..9f52b79 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,16 +1,16 @@ diff --git a/templates/login.html b/templates/login.html index 81f5c55..fdb5b57 100644 --- a/templates/login.html +++ b/templates/login.html @@ -17,6 +17,6 @@
-

Not a member? Create Account

+

Not a member? Create Account

diff --git a/templates/new_product.html b/templates/new_product.html index 29349e0..70b7e44 100644 --- a/templates/new_product.html +++ b/templates/new_product.html @@ -31,6 +31,6 @@
-

Want to view all of your products? Click Here

+

Want to view all of your products? Click Here

diff --git a/templates/signup.html b/templates/signup.html index c687685..312c008 100644 --- a/templates/signup.html +++ b/templates/signup.html @@ -28,6 +28,6 @@
-

Already have an account? Login

+

Already have an account? Login

diff --git a/templates/stats.html b/templates/stats.html index cbb0886..5e79016 100644 --- a/templates/stats.html +++ b/templates/stats.html @@ -43,15 +43,6 @@
{% if data != None %} {% for stat in data %} - -
{{stat.userID}}
-
-
-
£{{stat.productID}}
-
{{stat.viewDate}}
-
-
-
{% endfor %} {% endif %}