Skip to content

Commit 281c3e7

Browse files
Sorting the results by ranks where squares not available.
1 parent 106ab09 commit 281c3e7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

bullet/bullet_admin/views/results.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def dispatch(self, request, *args, **kwargs):
2929
def get_context_data(self, **kwargs):
3030
ctx = super().get_context_data(**kwargs)
3131
competition = get_active_competition(self.request)
32+
ctx["competition"] = competition
3233
ctx["country"], ctx["language"] = self.detection
3334
ctx["venues"] = Venue.objects.for_competition(competition)
3435
ctx["my_venues"] = Venue.objects.for_request(self.request)

bullet/problems/logic/results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def get_results(
2727

2828
return (
2929
ResultRow.objects.filter(id__in=rows)
30-
.order_by("-solved_count", "-solved_problems", "competition_time")
30+
.order_by("-solved_count", "-solved_problems", "competition_time", "team__rank_international")
3131
.select_related("team", "team__school", "team__venue", "team__venue__category")
3232
.prefetch_related("team__contestants", "team__contestants__grade")
3333
)

bullet/problems/templates/problems/results.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ <h2 class="text-2xl md:text-4xl mt-4 font-semibold">
3232
{% translate "International" %}
3333
</a>
3434

35-
{% for c in countries %}
35+
{% for c in countries %} {% if c != "__" %}
3636
<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 %}"
3737
class="{% if c == country %} bg-primary text-white font-bold {% else %} bg-gray-100 {% endif %} whitespace-nowrap py-1 px-2 rounded flex gap-2 items-center flex-wrap">
3838
<iconify-icon icon="flag:{{ c.code|lower }}-4x3" width="none" class="h-4 aspect-4/3"></iconify-icon>
3939
{{ c.name }}
4040
</a>
41-
{% endfor %}
41+
{% else %}
42+
<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 %}"
43+
class="{% if c == country %} bg-primary text-white font-bold {% else %} bg-gray-100 {% endif %} whitespace-nowrap py-1 px-2 rounded flex gap-2 items-center flex-wrap">
44+
Open
45+
</a>
46+
{% endif %} {% endfor %}
4247
</div>
4348
{% include "problems/results/table.html" %}
4449
</div>

0 commit comments

Comments
 (0)