forked from Hanabi/hanabi-league
remove player from participant list on own page
This commit is contained in:
parent
c6c9ab8377
commit
01bdd9544e
5 changed files with 7 additions and 6 deletions
|
@ -262,6 +262,7 @@ def group_games_by_player(games: List[GameRow]):
|
||||||
row = dataclasses.asdict(game)
|
row = dataclasses.asdict(game)
|
||||||
row["user_rating_change"] = round(game.user_rating_changes[i], 1)
|
row["user_rating_change"] = round(game.user_rating_changes[i], 1)
|
||||||
row["user_rating_after"] = round(game.user_ratings_after[i], 1)
|
row["user_rating_after"] = round(game.user_ratings_after[i], 1)
|
||||||
|
row["users"].remove(user)
|
||||||
ret[user].append(row)
|
ret[user].append(row)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
{% for rating_type in leaders %}
|
{% for rating_type in leaders %}
|
||||||
{{ games_table_js("tabledata", rating_type, True, False, False) }}
|
{{ games_table_js("tabledata", rating_type, True, False, False, "Players") }}
|
||||||
table_{{rating_type}}.setFilter("rating_type", "=", {{rating_type}});
|
table_{{rating_type}}.setFilter("rating_type", "=", {{rating_type}});
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
{% for rating_type in player_stat.keys() %}
|
{% 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
|
// Filter table on corresponding rating type
|
||||||
table_{{rating_type}}.setFilter("rating_type", "=", {{rating_type}});
|
table_{{rating_type}}.setFilter("rating_type", "=", {{rating_type}});
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
{% endmacro %}
|
{% 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}}", {
|
var table_{{div_id}} = new Tabulator("#table-{{div_id}}", {
|
||||||
maxHeight: 400,
|
maxHeight: 400,
|
||||||
data: {{data}},
|
data: {{data}},
|
||||||
|
@ -91,7 +91,7 @@ var table_{{div_id}} = new Tabulator("#table-{{div_id}}", {
|
||||||
{title: "+/-", field: "user_rating_change"},
|
{title: "+/-", field: "user_rating_change"},
|
||||||
{title: "ELO After", field: "user_rating_after"},
|
{title: "ELO After", field: "user_rating_after"},
|
||||||
{% endif %}
|
{% 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 => `<a href="/player/${encodeURIComponent(player)}">${player}</a>`);
|
let links = cell.getValue().map(player => `<a href="/player/${encodeURIComponent(player)}">${player}</a>`);
|
||||||
return links.join(", ");
|
return links.join(", ");
|
||||||
}},
|
}},
|
||||||
|
|
|
@ -78,10 +78,10 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
// Main table
|
// 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() %}
|
{% 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
|
// Filter table on corresponding page to only display games with corresponding player number
|
||||||
table_{{num_players}}.setFilter("num_players", "=", {{num_players}});
|
table_{{num_players}}.setFilter("num_players", "=", {{num_players}});
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue