diff --git a/bullet/bullet_admin/views/results.py b/bullet/bullet_admin/views/results.py index 25cf4b7d..23fc6e5c 100644 --- a/bullet/bullet_admin/views/results.py +++ b/bullet/bullet_admin/views/results.py @@ -30,6 +30,7 @@ def get_context_data(self, **kwargs): assert self.detection ctx = super().get_context_data(**kwargs) competition = get_active_competition(self.request) + ctx["competition"] = competition ctx["country"], ctx["language"] = self.detection ctx["venues"] = Venue.objects.for_competition(competition) ctx["my_venues"] = Venue.objects.for_request(self.request) diff --git a/bullet/problems/logic/results.py b/bullet/problems/logic/results.py index b9bdabae..4b7df18c 100644 --- a/bullet/problems/logic/results.py +++ b/bullet/problems/logic/results.py @@ -27,7 +27,12 @@ def get_results( return ( ResultRow.objects.filter(id__in=rows) - .order_by("-solved_count", "-solved_problems", "competition_time") + .order_by( + "-solved_count", + "-solved_problems", + "competition_time", + "team__rank_international", + ) .select_related("team", "team__school", "team__venue", "team__venue__category") .prefetch_related("team__contestants", "team__contestants__grade") ) diff --git a/bullet/problems/templates/problems/results.html b/bullet/problems/templates/problems/results.html index 6ad56366..80b28350 100644 --- a/bullet/problems/templates/problems/results.html +++ b/bullet/problems/templates/problems/results.html @@ -33,11 +33,18 @@

{% for c in countries %} + {% if c != "__" %}{# __ is the legacy OPEN category #} + class="{% if c == country %} bg-primary text-white font-bold {% else %} bg-gray-100 {% endif %} whitespace-nowrap py-1 px-2 rounded-sm flex gap-2 items-center flex-wrap"> {{ c.name }} + {% else %} + + Open + + {% endif %} {% endfor %} {% include "problems/results/table.html" %}