diff options
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -15,21 +15,35 @@ def home(): return render_template("index.j2") +@app.route("/guests", methods=["GET"]) +def get_guests(): + return render_template("guests.j2", guests=rg.players.guests) + + +@app.route("/decrement", methods=["POST"]) +def increment_guests(): + return render_template("guests.j2", guests=rg.players.decrement_guests()) + + +@app.route("/increment", methods=["POST"]) +def decrement_guests(): + return render_template("guests.j2", guests=rg.players.increment_guests()) + + @app.route("/propose", methods=["POST"]) def get_random_games(): levels = int(request.form["type"].split()[0]) - return render_template("games.j2", title="Proposal", games=rg.propose(levels)) + return render_template("games.j2", games=rg.propose(levels), title="Proposal") @app.route("/confirm", methods=["POST"]) def confirm_games(): - games = rg.confirm() - return render_template("games.j2", title=f"Round: {rg.round}", games=games) + return render_template("games.j2", games=rg.confirm(), title=f"Round: {rg.round}") @app.route("/clear", methods=["POST"]) def clear_games(): - return render_template("games.j2", title=f"Round: {rg.round}", games=rg.clear()) + return render_template("games.j2", games=rg.clear(), title=f"Round: {rg.round}") @app.route("/player-toggle/<player_request>", methods=["POST"]) |
