add basic functionality

This commit is contained in:
Wolfang Torres
2026-06-06 22:12:47 +08:00
parent 64380d2942
commit 345c1a8065
9 changed files with 189 additions and 90 deletions

View File

@@ -0,0 +1,25 @@
# Pip
from flask import Blueprint, render_template, request
mainapp = Blueprint("mainapp", __name__, template_folder="templates", url_prefix="/app", static_folder="static")
@mainapp.route("/", methods=["GET", "POST"])
def show():
if request.method == "GET":
args = request.args.to_dict()
deck_type = args.get("deck_type", "")
language = args.get("language", "")
output_type = args.get("output_type", "")
if not deck_type or not language or not output_type:
state = "new"
else:
print()
print(deck_type, language, output_type)
print()
state = "complete"
elif request.method == "POST":
state = "ready"
form = request.form.to_dict()
return render_template(f"app.html", data=locals())