fix order of leader cards

This commit is contained in:
Maximilian Keßler 2023-12-05 00:03:11 +01:00
parent 55148c48ab
commit 081601f0f7
Signed by: max
GPG key ID: BCC5A619923C0BA5
3 changed files with 6 additions and 8 deletions

View file

@ -67,7 +67,7 @@ body {
} }
.stat-description { .stat-description {
display: inline-block; display: inline-block;
width: 19em; width: 13em;
} }
.history-bullets { .history-bullets {
display: flex; display: flex;

View file

@ -2,8 +2,6 @@ import shutil
from pathlib import Path from pathlib import Path
from typing import Dict, List from typing import Dict, List
import subprocess
import jinja2 import jinja2
import datetime import datetime
import psycopg2.extras import psycopg2.extras
@ -82,7 +80,7 @@ def get_rating_lists() -> Dict[int, List[PlayerEntry]]:
rating_types = [utils.get_rating_type(x) for x in [False, True]] rating_types = [utils.get_rating_type(x) for x in [False, True]]
leaderboard = { leaderboard = {
utils.get_rating_type(x): [] utils.get_rating_type(x): []
for x in [True, False] for x in [False, True]
} }
for rating_type in rating_types: for rating_type in rating_types:
cur.execute( cur.execute(
@ -168,9 +166,9 @@ def get_variant_rows() -> List[VariantRow]:
" current_rating," " current_rating,"
" COUNT(games.id) AS games_played," " COUNT(games.id) AS games_played,"
" COUNT(games.id) FILTER (WHERE ratings.num_suits * 5 = games.score) AS games_won," " COUNT(games.id) FILTER (WHERE ratings.num_suits * 5 = games.score) AS games_won,"
" SUM(game_statistics.num_bottom_deck_risks) AS total_bdr," " COALESCE(SUM(game_statistics.num_bottom_deck_risks), 0) AS total_bdr,"
" SUM(game_statistics.num_crits_lost) AS total_crits_lost," " COALESCE(SUM(game_statistics.num_crits_lost), 0) AS total_crits_lost,"
" SUM(games.num_turns) AS total_turns " " COALESCE(SUM(games.num_turns), 0) AS total_turns "
"FROM " "FROM "
" (" " ("
" SELECT DISTINCT ON (variants.id, variant_base_ratings.num_players)" " SELECT DISTINCT ON (variants.id, variant_base_ratings.num_players)"

View file

@ -79,6 +79,6 @@ def get_rating_type(clue_starved: bool):
def describe_rating_type(rating_type: int): def describe_rating_type(rating_type: int):
if rating_type == 0: if rating_type == 0:
return "Standard" return "No Variant"
elif rating_type == 1: elif rating_type == 1:
return "Clue Starved" return "Clue Starved"