From c0d2b9eb7e2b65b582039aafdca765fe32acf81e Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 27 Apr 2024 21:21:51 +0200 Subject: Flesh out 'join' user flow This commit splits the user flow when sending in an application to join the guild into three staged: 1. Intro text 2. HTML form 3. Form submission feedback (aka. "yay it went through") --- app.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index c64c280..de7a1d3 100644 --- a/app.py +++ b/app.py @@ -43,11 +43,15 @@ def callback(): return f'Access token: {token_response.get("access_token")}' -@app.route("/join.html") +@app.route("/join_intro.html") +def join_intro(): + return template("join_intro") + +@app.route("/join_form.html") def join_form(): - return template("join") + return template("join_form") -@app.route("/join.html", method="POST") +@app.route("/join_form.html", method="POST") def join_submission(db): name = request.forms.get("name") preferred_role = request.forms.get("preferredRole") @@ -64,6 +68,8 @@ def join_submission(db): db.execute(f"INSERT INTO applications(name, role, motivation) VALUES ({name}, {preferred_role}, {motivation})") + return template("join_success") + @app.route("//") def server_static(type, filename): return static_file(filename, root=f"./static/{type}/") -- cgit v1.2.3