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
92 changes: 48 additions & 44 deletions bullet/bullet_admin/templates/bullet_admin/results/announce.html
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
{% extends "web/root_base.html" %}
{% load results %}

{% block title %}
Results announcement
Results announcement
{% endblock title %}

{% block root_content %}
<div class="w-screen h-screen flex items-center justify-center p-16"
id="js-screen"
hx-select="#js-screen"
hx-target="#js-screen"
hx-swap="outerHTML">
{% if not hidden %}
<div class="text-center">
<div class="text-9xl font-bold mb-6 text-gray-600">{{ position }}.</div>
{% if team %}
{% if team.school %}
<div class="text-7xl font-bold mb-4">
{{ team.school.name }}
{% if team.in_school_symbol %}
<span class="text-primary">{{ team.in_school_symbol }}</span>
{% endif %}
</div>
<div class="text-5xl font-bold mb-6">{{ team.school.address }}</div>
{% else %}
<div class="text-5xl font-bold mb-6">{{ team.name }}</div>
{% endif %}
<div class="text-3xl">{{ team.contestants_names }}</div>
<div class="flex justify-center">{% big_squares result_row %}</div>
<div class="text-4xl mt-4">{{ result_row.solved_count }}</div>
{% endif %}
</div>
<div class="w-screen h-screen flex items-center justify-center p-16"
id="js-screen"
hx-select="#js-screen"
hx-target="#js-screen"
hx-swap="outerHTML">
{% if not hidden %}
<div class="text-center">
<div class="text-9xl font-bold mb-6 text-gray-600">{{ position }}.</div>
{% if team %}
{% if team.school %}
{# TODO: #998 Unify team display #}
<div class="text-7xl font-bold mb-4">
{{ team.school.name }}
{% if team.in_school_symbol %}
<span class="text-primary">{{ team.in_school_symbol }}</span>
{% endif %}
</div>
<div class="text-5xl font-bold mb-6">{{ team.school.address }}</div>
{% else %}
<div class="text-5xl font-bold mb-6">{{ team.name }}</div>
{% endif %}
<div class="p-2 fixed bottom-0 right-0 space-x-1">
<span>{{ position }}.</span>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.prev }}"
hx-trigger="click, keyup[key=='ArrowDown'||key=='Backspace'] from:body">
<i class="fas fa-arrow-down"></i>
</button>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.hide }}"
hx-trigger="click, keyup[key=='h'] from:body">
<i class="fas fa-eye-slash"></i>
</button>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.next }}"
hx-trigger="click, keyup[key=='ArrowUp'||key==' '] from:body">
<i class="fas fa-arrow-up"></i>
</button>
</div>

<div class="text-3xl">{{ team.contestants_names }}</div>
<div class="flex justify-center">{% squares result_row big=True %}</div>
<div class="text-4xl mt-4">{{ result_row.solved_count }}</div>
{% endif %}
</div>
{% endif %}

<div class="p-2 fixed bottom-0 right-0 space-x-1">
<span>{{ position }}.</span>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.prev }}"
hx-trigger="click, keyup[key=='ArrowDown'||key=='Backspace'] from:body">
<i class="fas fa-arrow-down"></i>
</button>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.hide }}"
hx-trigger="click, keyup[key=='h'] from:body">
<i class="fas fa-eye-slash"></i>
</button>
<button class="btn-admin-sm bg-primary hover:bg-primary-dark"
hx-get="{{ links.next }}"
hx-trigger="click, keyup[key=='ArrowUp'||key==' '] from:body">
<i class="fas fa-arrow-up"></i>
</button>
</div>
</div>
{% endblock root_content %}
104 changes: 51 additions & 53 deletions bullet/competitions/templates/teams/list.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{% extends "web/base.html" %}
{% load content_blocks countries country_url i18n static %}
{% load content_blocks countries country_url i18n static teams %}
{% block title %}
{% if is_waitinglist %}
{% translate "Waiting list" %}
{% else %}
{% translate "Team list" %}
{% endif %}
{% if is_waitinglist %}
{% translate "Waiting list" %}
{% else %}
{% translate "Team list" %}
{% endif %}
{% endblock title %}

{% block hero %}
<h1 class="text-4xl md:text-6xl font-bold mt-8 md:mt-24 mb-4 md:mb-16">
{% if is_waitinglist %}
{% translate "Waiting list" %}
{% else %}
{% translate "Team list" %}
{% endif %}
</h1>
<h1 class="text-4xl md:text-6xl font-bold mt-8 md:mt-24 mb-4 md:mb-16">
{% if is_waitinglist %}
{% translate "Waiting list" %}
{% else %}
{% translate "Team list" %}
{% endif %}
</h1>
{% endblock hero %}

{% block content %}
{% load_blocks "category" %}
<div class="container mx-auto px-2 mt-8">
<div class="flex flex-wrap justify-center gap-1 mb-2">
<div class="max-w-7xl mx-auto px-6 lg:px-8 mt-8">
<div class="flex flex-wrap gap-1 mb-2">
{% for c in countries %}
<a href="?country={{ c }}"
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">
Expand All @@ -32,47 +32,45 @@ <h1 class="text-4xl md:text-6xl font-bold mt-8 md:mt-24 mb-4 md:mb-16">
</a>
{% endfor %}
</div>
<div class="mb-4 text-center">
{% if is_waitinglist %}
<a href="{% country_url "team_list" %}?country={{ country }}"
class="link-primary">{% translate "Team list" %}</a>
{% else %}
<a href="{% country_url "waiting_list" %}?country={{ country }}"
class="link-primary">{% translate "Waiting list" %}</a>
{% endif %}

<div class="mb-4">
{% if is_waitinglist %}
<a href="{% country_url "team_list" %}?country={{ country }}" class="link-primary">{% translate "Team list" %}</a>
{% else %}
<a href="{% country_url "waiting_list" %}?country={{ country }}" class="link-primary">{% translate "Waiting list" %}</a>
{% endif %}
</div>

<div class="mb-8">
<ul class="list-disc list-inside">
{% for v in venues %}
<li><a href="#{{ v.venue.shortcode }}" class="link-primary">{{ v.venue.name }} ({% content_block "category:name_"|add:v.venue.category.identifier %})</a></li>
{% endfor %}
</ul>
</div>

{% for v in venues %}
<div class="mb-8">
<div class="flex flex-col md:flex-row md:items-baseline md:justify-between px-4 py-2 rounded">
<h2 class="font-bold text-2xl">
{{ v.venue.name }}
<span class="text-lg text-gray-600">({% content_block "category:name_"|add:v.venue.category.identifier %})</span>
</h2>
{% if not is_waitinglist %}
<div class="shrink-0 text-gray-600">
{% blocktranslate with teams=v.teams|length capacity=v.venue.capacity %}Teams: {{ teams }} / {{ capacity }}{% endblocktranslate %}
</div>
{% endif %}
</div>
{% for team in v.teams %}
<div class="flex flex-col md:flex-row md:items-center px-4 py-2 {% cycle "bg-gray-50" "" %} rounded-md">
<div class="md:w-1/2 mb-1 md:mb-0">
{% if team.school %}
<div class="text-primary font-bold">
{{ team.school.name }}
{% if team.in_school_symbol %}
<span class="text-white bg-primary rounded px-1.5 py-0.5 text-sm">{{ team.in_school_symbol }}</span>
{% endif %}
</div>
<div class="text-sm text-gray-600">{{ team.school.address }}</div>
{% else %}
<div class="text-primary font-bold">{{ team.name }}</div>
{% endif %}
</div>
<div class="md:w-1/2 text-sm">{{ team.contestants.all|join:", " }}</div>
</div>
{% endfor %}
<div class="mb-8">
<h2 class="font-bold text-2xl" id="{{ v.venue.shortcode }}">
{{ v.venue.name }}
<span class="text-lg text-gray-500">({% content_block "category:name_"|add:v.venue.category.identifier %})</span>
</h2>

{% if not is_waitinglist %}
<div class="shrink-0 text-gray-500">
{% blocktranslate with teams=v.teams|length capacity=v.venue.capacity %}Teams: {{ teams }} / {{ capacity }}{% endblocktranslate %}
</div>
{% endif %}

<div class="space-y-3 mt-4">
{% for team in v.teams %}
<div>
{% inline_team_name team %}
<div class="text-xs mt-0.5 text-gray-500">{{ team.contestants.all|join:", " }}</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endblock content %}
63 changes: 31 additions & 32 deletions bullet/problems/templates/problems/results.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
{% extends "web/base.html" %}
{% load content_blocks country_url i18n utils %}
{% block title %}
{% translate "Results" %}
{% translate "Results" %}
{% endblock title %}

{% block extrahead %}
{{ block.super }}
{% if country %}
<link rel="canonical"
href="{% country_url "archive_results_category" competition_number=competition.number category=category.identifier country=country|lower %}">
{% else %}
<link rel="canonical"
href="{% country_url "archive_results_category" competition_number=competition.number category=category.identifier %}">
{% endif %}
{{ block.super }}

{% if country %}
<link rel="canonical" href="{% country_url "archive_results_category" competition_number=competition.number category=category.identifier country=country|lower %}">
{% else %}
<link rel="canonical" href="{% country_url "archive_results_category" competition_number=competition.number category=category.identifier %}">
{% endif %}
{% endblock extrahead %}

{% block hero %}
{% load_blocks "category" %}
<div class="mt-8 md:mt-24 mb-4 md:mb-16">
<h1 class="text-4xl md:text-6xl font-bold">{% translate "Results" %}</h1>
<h2 class="text-2xl md:text-4xl mt-4 font-bold">
{% content_block "category:name_"|add:category.identifier %}, {{ country_name }}, {{ competition.name }}
</h2>
</div>
{% load_blocks "category" %}
<div class="mt-8 md:mt-24 mb-4 md:mb-16">
<h1 class="text-4xl md:text-6xl font-bold">{% translate "Results" %}</h1>
<h2 class="text-2xl md:text-4xl mt-4 font-semibold">
{% content_block "category:name_"|add:category.identifier %}, {{ country_name }}, {{ competition.name }}
</h2>
</div>
{% endblock hero %}

{% block content %}
<div class="container mx-auto px-2 mt-8">
<div class="flex flex-wrap justify-center gap-1 mb-12">
<a href="{% if competition_number %}{% country_url "archive_results_category" category=category.identifier competition_number=competition_number %}{% else %}{% country_url "results_category" category=category.identifier %}{% endif %}{% query_transform %}"
class="{% if not country %} bg-primary text-white font-bold {% else %} bg-gray-100 {% endif %} whitespace-nowrap py-1 px-2 rounded">
{% translate "International" %}
</a>
{% for c in countries %}
<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 flex gap-2 items-center flex-wrap">
<span class="iconify shrink-0 shadow-lg"
data-icon="flag:{{ c.code|lower }}-4x3"></span>
{{ c.name }}
</a>
{% endfor %}
</div>
{% include "problems/results/table.html" %}
<div class="max-w-7xl mx-auto px-6 lg:px-8 mt-8">
<div class="flex flex-wrap gap-1 mb-8">
<a href="{% if competition_number %}{% country_url "archive_results_category" category=category.identifier competition_number=competition_number %}{% else %}{% country_url "results_category" category=category.identifier %}{% endif %}{% query_transform %}"
class="{% if not country %} bg-primary text-white font-bold {% else %} bg-gray-100 {% endif %} whitespace-nowrap py-1 px-2 rounded">
{% translate "International" %}
</a>

{% for c in countries %}
<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 flex gap-2 items-center flex-wrap">
<iconify-icon icon="flag:{{ c.code|lower }}-4x3" width="none" class="h-4"></iconify-icon>
{{ c.name }}
</a>
{% endfor %}
</div>
{% include "problems/results/table.html" %}
</div>
{% endblock content %}
19 changes: 13 additions & 6 deletions bullet/problems/templates/problems/results/squares.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<div class="flex flex-wrap gap-0.5">
{% for sq in squares %}
<div title="{{ forloop.counter|add:offset }}"
class="shrink-0 rounded {% if big %} w-8 font-medium h-8 flex justify-center items-center {% else %} w-3 h-3 {% endif %} {% if forloop.counter|divisibleby:5 %} me-1 break-after-auto {% else %} break-after-avoid {% endif %} {% if sq == 2 %} bg-primary {% elif sq == 1 %} bg-white ring-inset ring-2 ring-primary {% else %} bg-gray-200 {% endif %}">
{% if big %}{{ forloop.counter|add:offset }}{% endif %}
</div>
{# django #}
<div class="flex flex-wrap {% if big %}gap-2{% else %}gap-1{% endif %}">
{% for group in squares %}
<div class="break-inside-avoid flex gap-0.5 shrink-0">
{% for sq in group %}
<div title="{{ sq.problem }}"
class="shrink-0
{% if big %}size-8 font-semibold flex justify-center items-center rounded{% else %}size-2 rounded-sm{% endif %}
{% if sq.state == 2 %}bg-primary text-white{% elif sq.state == 1 %}text-primary bg-white ring-inset {% if big %}ring-2{% else %}ring-1{% endif %} ring-primary{% else %}text-gray-600 bg-gray-200{% endif %}">
{% if big %}{{ sq.problem }}{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
Loading