diff --git a/flaskr/templates/game_id.html b/flaskr/templates/game_id.html
index 6e909f7..fcbe0f8 100644
--- a/flaskr/templates/game_id.html
+++ b/flaskr/templates/game_id.html
@@ -11,18 +11,18 @@ table, tr, td {
Times
- | Time |
Course |
Cup |
+ Time |
User |
{% if times_exist %}
{% for time in times %}
- | time[0] |
- time[1] |
- time[2] |
- time[3] |
+ {{time[0]}} |
+ {{time[1]}} |
+ {{time[2]}} |
+ {{time[3]}} |
{% endfor %}
{% endif %}
diff --git a/flaskr/utils/games.py b/flaskr/utils/games.py
index d0ffeff..0514f92 100644
--- a/flaskr/utils/games.py
+++ b/flaskr/utils/games.py
@@ -26,6 +26,13 @@ def get_game_name(id: int):
def get_all_times_in_game(id: int):
- sql = "SELECT courses.name, times.course_id, users.username FROM times JOIN courses ON courses.id=times.course_id JOIN users ON users.id=times.user_id WHERE times.course_id=:id"
+ sql = """
+ SELECT courses.name, cups.name, times.timems, users.username
+ FROM times
+ JOIN courses ON courses.id=times.course_id
+ JOIN cups ON cups.id=times.cup_id
+ JOIN users ON users.id=times.user_id
+ WHERE times.game_id=:id
+ """
results = db.session.execute(sql, {"id": id}).fetchall()
return results
diff --git a/flaskr/views/games.py b/flaskr/views/games.py
index 90ef89b..f01a6ec 100644
--- a/flaskr/views/games.py
+++ b/flaskr/views/games.py
@@ -26,7 +26,9 @@ def get_game_by_id(game_id):
"error.html", message="Incorrect id, id not found or incorrect value"
)
times = get_all_times_in_game(game_id)
- return render_template("game_id.html", game_name=game_name, times=times)
+ return render_template(
+ "game_id.html", times_exist=True, game_name=game_name, times=times
+ )
@app.route("/api/game/")