Include form after answers

This commit is contained in:
Nate Bowman
2026-10-28 20:06:45 -04:00
parent f549c32fca
commit a102325f0e

View File

@@ -34,15 +34,16 @@ fight = Fighting(data, nums)
@app.route("/", methods=["GET", "POST"]) @app.route("/", methods=["GET", "POST"])
def serve_things(): def serve_things():
questions = render_template('main.html', units=sorted(fight.list_units()))
if request.method == "POST": if request.method == "POST":
options = defaultdict(int) options = defaultdict(int)
options.update(request.form) options.update(request.form)
return show_fight((request.form['attacker'], return show_fight((request.form['attacker'],
request.form['defender']), request.form['defender']),
options) options) + '<br><br>' + questions
if request.method == "GET": if request.method == "GET":
return render_template('main.html', units=sorted(fight.list_units())) return questions
def show_fight(names, options): def show_fight(names, options):