{% extends "three-column-content.html" %} {% block meta %} {% endblock %} {% block three_col_media %} {% endblock %} {% block three_col_js %} {% endblock %} {% block left_sidebar %} {% include "contest/contest-list-tabs.html" %} {% endblock %} {% block right_sidebar %} {% endblock %} {% macro contest_head(contest) %} {{contest.name}}
{% if not contest.is_visible %} {{ _('hidden') }} {% endif %} {% if contest.is_editable %} {{ _('Edit') }} {% endif %} {% if contest.is_private %} {{ _('private') }} {% endif %} {% if not hide_contest_orgs %} {% if contest.is_organization_private %} {% for org in contest.organizations.all() %} {% include "organization/tag.html" %} {% endfor %} {% endif %} {% endif %} {% if contest.is_rated %} {{ _('rated') }} {% endif %} {% for tag in contest.tags.all() %} {{- tag.name -}} {% endfor %}
{% endmacro %} {% macro time_left(contest) %}
{% if contest.time_limit %}
{{_("Start")}}: {{ contest.start_time|date(_("H:i d/m/Y")) }}
{{_("End")}}: {{ contest.end_time|date(_("H:i d/m/Y")) }}
{% else %}
{{_("Start")}}: {{ contest.start_time|date(_("H:i d/m/Y")) }}
{% endif %}
{{_("Length")}}: {% if contest.time_limit %} {% trans time_limit=contest.time_limit|timedelta('localized-no-seconds') %}{{ time_limit }}{% endtrans %} {% else %} {% trans duration=contest.contest_window_length|timedelta('localized-no-seconds') %}{{ duration }}{% endtrans %} {% endif %}
{% endmacro %} {% macro user_count(contest, user) %} {% if contest.can_see_own_scoreboard(user) %} {{ contest.user_count }} {% else %} {{ contest.user_count }} {% endif %} {% endmacro %} {% macro contest_join(contest, request) %} {% if request.in_contest and request.participation.contest == contest %} {% elif request.profile.id in contest.editor_ids or request.profile.id in contest.tester_ids %}
{% csrf_token %}
{% else %}
{% csrf_token %}
{% endif %} {% endmacro %} {% macro contest_format_user(contest, show_user=True) %}
{{ _('Format') }}
{{ contest.format.name }}
{% if show_user %}
{{ user_count(contest, request.user) }}
{% endif %}
{% endmacro %} {% block middle_content %}
{% if request.user.is_authenticated and current_tab == 'active' %} {% if contests %} {% for participation in contests %} {% with contest=participation.contest %}
{{ _('Contests') }}
{{ contest_head(contest) }}
{{ _('Time') }}
{% if contest.start_time %} {{ time_left(contest) }} {% if contest.time_limit %} {% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %} {% elif contest.time_before_end %} {% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %} {% endif %} {% endif %}
{{ contest_format_user(contest) }}
{{ contest_join(contest, request) }}
{% endwith %} {% endfor %} {% if page_obj and page_obj.num_pages > 1 %}
{% include "list-pages.html" %}
{% endif %} {% else %} {{ _('There is no active contest at this time.') }} {% endif %} {% endif %} {% if current_tab == 'current' %} {% if contests %} {% for contest in contests %}
{{ _('Contests') }}
{{ contest_head(contest) }}
{{ _('Time') }}
{% if contest.start_time %} {{ time_left(contest) }} {% if contest.time_before_end %} {% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %} {% endif %} {% endif %}
{{ contest_format_user(contest) }}
{{ contest_join(contest, request) }}
{% endfor %} {% if page_obj and page_obj.num_pages > 1 %}
{% include "list-pages.html" %}
{% endif %} {% else %} {{ _('There is no ongoing contest at this time.') }} {% endif %} {% endif %} {% if current_tab == 'future' %} {% if contests %} {% for contest in contests %}
{{ _('Contests') }}
{{ contest_head(contest) }}
{{ _('Time') }}
{% if contest.start_time %} {{ time_left(contest) }} {% if contest.time_before_start %} {{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }} {% endif %} {% endif %}
{{ contest_format_user(contest, show_user=False) }}
{% endfor %} {% if page_obj and page_obj.num_pages > 1 %}
{% include "list-pages.html" %}
{% endif %} {% else %} {{ _('There is no scheduled contest at this time.') }} {% endif %} {% endif %} {% if current_tab == 'past' %} {% if contests %} {% for contest in contests %}
{{ _('Contests') }}
{{ contest_head(contest) }}
{{ _('Time') }}
{{ time_left(contest) }}
{{ contest_format_user(contest) }}
{% if request.in_contest and request.participation.contest == contest %} {% else %}
{% csrf_token %}
{% endif %}
{% endfor %} {% if page_obj and page_obj.num_pages > 1 %}
{% include "list-pages.html" %}
{% endif %} {% else %} {{ _('There is no past contest.') }} {% endif %} {% endif %} {% endblock %}