Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bullet/bullet_admin/views/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion bullet/problems/logic/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
9 changes: 8 additions & 1 deletion bullet/problems/templates/problems/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@ <h2 class="text-2xl md:text-4xl mt-4 font-semibold">
</a>

{% for c in countries %}
{% if c != "__" %}{# __ is the legacy OPEN category #}
<a href="{% if competition_number %}{% country_url "archive_results_category" category=category.identifier competition_number=competition_number country=c.code|lower %}{% else %}{% country_url "results_category" category=category.identifier country=c.code|lower %}{% endif %}{% query_transform %}"
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">
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">
<iconify-icon icon="flag:{{ c.code|lower }}-4x3" width="none" class="h-4 aspect-4/3"></iconify-icon>
{{ c.name }}
</a>
{% else %}
<a href="{% if competition_number %}{% country_url "archive_results_category" category=category.identifier competition_number=competition_number country=c.code|lower %}{% else %}{% country_url "results_category" category=category.identifier country=c.code|lower %}{% endif %}{% query_transform %}"
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">
Open
</a>
{% endif %}
{% endfor %}
</div>
{% include "problems/results/table.html" %}
Expand Down