From 316ee30be13c8c7c517655db96b78e0e094fbdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 11 Jan 2024 19:27:54 +0100 Subject: [PATCH] Add suit count to tables --- src/render_site.py | 7 ++++--- templates/stats_table.html | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/render_site.py b/src/render_site.py index d6a5ab0..2f3127e 100644 --- a/src/render_site.py +++ b/src/render_site.py @@ -112,6 +112,7 @@ class GameRow: user_ratings_after: List[float] variant_id: int variant_name: str + num_suits: id rating_type: int seed: str score: int @@ -176,6 +177,7 @@ def get_games() -> List[GameRow]: " user_ratings_after," " game_data.variant_id," " variants.name AS variant_name," + " variants.num_suits," " rating_type," " seed," " score," @@ -226,7 +228,7 @@ def get_games() -> List[GameRow]: " ON variant_ratings.league_id = game_data.league_id AND variant_ratings.primary_change = true " "GROUP BY (" " game_data.game_id, game_data.num_players, users, user_ids, game_data.variant_id, variants.name, seed, score, num_turns," - " game_data.league_id, num_bottom_deck_risks, num_crits_lost, change, value_after, rating_type, user_rating_changes, user_ratings_after, datetime_finished" + " game_data.league_id, num_bottom_deck_risks, num_crits_lost, change, value_after, rating_type, user_rating_changes, user_ratings_after, datetime_finished, num_suits" " ) " "ORDER BY league_id DESC", (True,) @@ -843,5 +845,4 @@ def render_all(): if __name__ == "__main__": - render_all() - + render_all() \ No newline at end of file diff --git a/templates/stats_table.html b/templates/stats_table.html index 593876f..5edd5e2 100644 --- a/templates/stats_table.html +++ b/templates/stats_table.html @@ -82,6 +82,7 @@ var table_{{div_id}} = new Tabulator("#table-{{div_id}}", { }}, {% if show_player_num %} {title: "#P", field: "num_players"}, + {title: "#S", field: "num_suits"}, {% endif %} {% if show_var_rating %} {title: "+/-", field: "variant_rating_change"},