From 9e0ed8ab5bd3c81b0e9003bd403c3c655c7b6fed Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 4 Dec 2020 23:25:49 +0100 Subject: [PATCH] Add Seeds Table --- WebHostLib/templates/hostGame.html | 26 ++++++++++++++++++++++++++ WebHostLib/upload.py | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/WebHostLib/templates/hostGame.html b/WebHostLib/templates/hostGame.html index 7505aa7d..59bd55c0 100644 --- a/WebHostLib/templates/hostGame.html +++ b/WebHostLib/templates/hostGame.html @@ -53,6 +53,32 @@ {% endif %} + {% if seeds %} +

Your Games:

+ + + + + + + + + + {% for seed in seeds %} + + + + + + {% endfor %} + +
SeedPlayersCreated (UTC)
{{ seed.id|suuid }}{% if seed.multidata %}{{ seed.multidata.names[0]|length }}{% else %}1{% endif %} + {{ seed.creation_time.strftime("%Y-%m-%d %H:%M") }}
+ {% endif %} diff --git a/WebHostLib/upload.py b/WebHostLib/upload.py index 9313c285..6f1fe619 100644 --- a/WebHostLib/upload.py +++ b/WebHostLib/upload.py @@ -70,7 +70,8 @@ def uploads(): else: flash("Not recognized file format. Awaiting a .multidata file.") rooms = select(room for room in Room if room.owner == session["_id"]) - return render_template("hostGame.html", rooms=rooms) + seeds = select(seed for seed in Seed if seed.owner == session["_id"]) + return render_template("hostGame.html", rooms=rooms, seeds=seeds) def allowed_file(filename):