better variant sorting

This commit is contained in:
Maximilian Keßler 2023-12-08 22:16:35 +01:00
parent 0e0bb06780
commit 45300c1779
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 4 additions and 3 deletions

View file

@ -335,6 +335,7 @@ def get_variant_rows() -> List[VariantRow]:
" SELECT DISTINCT ON (variants.id, variant_base_ratings.num_players)"
" variants.id,"
" variants.num_suits,"
" variants.clue_starved,"
" name,"
" variant_base_ratings.num_players,"
" COALESCE(variant_ratings.value_after, variant_base_ratings.rating) AS current_rating "
@ -354,8 +355,8 @@ def get_variant_rows() -> List[VariantRow]:
" ON games.variant_id = ratings.id AND games.num_players = ratings.num_players "
"LEFT OUTER JOIN game_statistics"
" ON games.id = game_statistics.game_id "
"GROUP BY (ratings.id, ratings.name, ratings.num_players, ratings.current_rating)"
"ORDER BY (ratings.id, ratings.num_players)"
"GROUP BY (ratings.id, ratings.name, ratings.clue_starved, ratings.num_players, ratings.current_rating, ratings.num_suits)"
"ORDER BY (ratings.clue_starved, ratings.num_suits, ratings.num_players)"
""
)
return [

View file

@ -19,7 +19,7 @@
</li>
{% endfor %}
<li class="nav-item">
<a class="nav-link" id="Back" href="/">Back to Main Site</a>
<a class="nav-link" id="Back" href="/">Back</a>
</li>
</ul>
</div>