aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2024-10-16 16:20:13 +0200
committerKaran Jayachandra <karan.jayachandra@nxp.com>2024-10-16 16:20:13 +0200
commitb581661c993095c43ad19540999ab21957d0e013 (patch)
tree3a8259e7d4b224142752975d5f95b40313a71378 /app.py
parent0a4dac8168d726707a46b9aa60a257ecaba6a620 (diff)
Added guests funtionality
Diffstat (limited to 'app.py')
-rw-r--r--app.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/app.py b/app.py
index c6f7af1..a37be7c 100644
--- a/app.py
+++ b/app.py
@@ -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"])