From 88f553a08e5b0d29bcfb3cfac96a568c0b448160 Mon Sep 17 00:00:00 2001 From: Stef <48526421+StefBuwalda@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:38:40 +0200 Subject: [PATCH] New webpage structure, not yet finished. Change password implemented again (#11) * Adjusted GUI of daily dashboard to better deal with float values * Change password + New base (#10) * created a new Base template to test with * Changed out the base and added a new password page * Password change works, UI needs redisgn --- app.py | 12 ++-- application/auth/routes.py | 7 +- .../auth/templates/new_change_password.html | 52 ++++++++++++++ application/templates/base.html | 72 ++----------------- application/templates/flash.html | 9 +++ application/templates/navbar.html | 51 +++++++++++++ application/templates/new_navbar.html | 60 ++++++++++++++++ 7 files changed, 190 insertions(+), 73 deletions(-) create mode 100644 application/auth/templates/new_change_password.html create mode 100644 application/templates/flash.html create mode 100644 application/templates/navbar.html create mode 100644 application/templates/new_navbar.html diff --git a/app.py b/app.py index 8659ea8..b623d38 100644 --- a/app.py +++ b/app.py @@ -1,8 +1,4 @@ -from flask import ( - redirect, - url_for, - send_from_directory, -) +from flask import redirect, url_for, send_from_directory, render_template from flask_login import ( login_required, current_user, @@ -54,6 +50,12 @@ def index(): return redirect(url_for("auth.login")) +@app.route("/test") +@login_required +def text(): + return render_template("newBase.html") + + @app.route("/favicon.ico") def favicon(): return send_from_directory("static", "favicon.ico") diff --git a/application/auth/routes.py b/application/auth/routes.py index b14c3f9..10314ce 100644 --- a/application/auth/routes.py +++ b/application/auth/routes.py @@ -35,8 +35,8 @@ def login(): return render_template("login.html", form=form) -@bp.route("/change_password", methods=["GET", "POST"]) -def change_password(): +@bp.route("/change_pass", methods=["GET", "POST"]) +def change_pass(): if not current_user.is_authenticated: return redirect(url_for("auth.login")) @@ -50,8 +50,9 @@ def change_password(): current_user.change_password(form.new_password.data) current_user.set_pw_change(False) db.session.commit() + logout_user() return default_return() - return render_template("change_password.html", form=form) + return render_template("new_change_password.html", form=form) @bp.route("/logout") diff --git a/application/auth/templates/new_change_password.html b/application/auth/templates/new_change_password.html new file mode 100644 index 0000000..e9ffbe2 --- /dev/null +++ b/application/auth/templates/new_change_password.html @@ -0,0 +1,52 @@ +{% extends "base.html" %} + +{% block title %}Change Password{%endblock%} + +{% block content %} + + +
+ Make sure your password is at least 8 characters long and includes a mix of letters and numbers. +
+{{ message }}
- {% endfor %} -{{ message }}
+ {% endfor %} +