Include form after answers
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user