{% extends "three-column-content.html" %} {% block meta %} {% endblock %} {% block three_col_media %} {% block contest_list_media %}{% endblock %} {% endblock %} {% block three_col_js %} {% block contest_list_js %}{% endblock %} {% endblock %} {% block left_sidebar %} {% include "contest/contest-list-tabs.html" %} {% endblock %} {% block right_sidebar %} {% endblock %} {% from "contest/macros.html" import contest_head, time_left, user_count, contest_format_user %} {% macro contest_join(contest, request, is_past=False) %} {% if request.in_contest and request.participation.contest == contest %} {% elif is_past %}
{% csrf_token %}
{% elif request.profile.id in contest.editor_ids or request.profile.id in contest.tester_ids %}
{% csrf_token %}
{% else %}
{% csrf_token %}
{% 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, organization) }}
{{ _('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, request, is_official=is_official) }}
{{ 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, organization) }}
{{ _('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, request, is_official=is_official) }}
{{ 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, organization) }}
{{ _('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, request, show_user=False, is_official=is_official) }}
{% 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, organization) }}
{{ _('Time') }}
{{ time_left(contest) }}
{{ contest_format_user(contest, request, is_official=is_official) }}
{{ contest_join(contest, request, is_past=True) }}
{% endfor %} {% if page_obj and page_obj.num_pages > 1 %}
{% include "list-pages.html" %}
{% endif %} {% else %} {{ _('There is no past contest.') }} {% endif %} {% endif %} {% endblock %}