diff --git a/src/render_site.py b/src/render_site.py index be63e2c..dd15b82 100644 --- a/src/render_site.py +++ b/src/render_site.py @@ -262,6 +262,7 @@ def group_games_by_player(games: List[GameRow]): row = dataclasses.asdict(game) row["user_rating_change"] = round(game.user_rating_changes[i], 1) row["user_rating_after"] = round(game.user_ratings_after[i], 1) + row["users"].remove(user) ret[user].append(row) return ret diff --git a/templates/main.html b/templates/main.html index e74338a..09c547c 100644 --- a/templates/main.html +++ b/templates/main.html @@ -188,7 +188,7 @@ diff --git a/templates/player.html b/templates/player.html index 8553b7c..72fed17 100644 --- a/templates/player.html +++ b/templates/player.html @@ -51,7 +51,7 @@ ]; {% for rating_type in player_stat.keys() %} - {{ games_table_js("tabledata", rating_type, True, False, True) }} + {{ games_table_js("tabledata", rating_type, True, False, True, "Teammates") }} // Filter table on corresponding rating type table_{{rating_type}}.setFilter("rating_type", "=", {{rating_type}}); {% endfor %} diff --git a/templates/stats_table.html b/templates/stats_table.html index b3fa4d4..b8be1cc 100644 --- a/templates/stats_table.html +++ b/templates/stats_table.html @@ -65,7 +65,7 @@ {% endmacro %} -{% macro games_table_js(data, div_id, show_player_num, show_var_rating, show_user_rating) %} +{% macro games_table_js(data, div_id, show_player_num, show_var_rating, show_user_rating, player_description) %} var table_{{div_id}} = new Tabulator("#table-{{div_id}}", { maxHeight: 400, data: {{data}}, @@ -91,7 +91,7 @@ var table_{{div_id}} = new Tabulator("#table-{{div_id}}", { {title: "+/-", field: "user_rating_change"}, {title: "ELO After", field: "user_rating_after"}, {% endif %} - {title: "Players", field: "users", formatter:function(cell, formatterParams, onRendered) { + {title: "{{player_description}}", field: "users", formatter:function(cell, formatterParams, onRendered) { let links = cell.getValue().map(player => `${player}`); return links.join(", "); }}, diff --git a/templates/variant.html b/templates/variant.html index b0caba7..aec6483 100644 --- a/templates/variant.html +++ b/templates/variant.html @@ -78,10 +78,10 @@ ]; // Main table - {{ games_table_js("tabledata", "overview", True, False, False) }} + {{ games_table_js("tabledata", "overview", True, False, False, "Players") }} {% for num_players in variant_stats_by_player.keys() %} - {{ games_table_js("tabledata", num_players, False, True, False) }} + {{ games_table_js("tabledata", num_players, False, True, False, "Players") }} // Filter table on corresponding page to only display games with corresponding player number table_{{num_players}}.setFilter("num_players", "=", {{num_players}}); {% endfor %}