{% extends "layout/basic.html" %} {% import "components/contest.html" as contest with context %} {% macro render_important_contest(view, title, tdoc) %}

{{ _(title) }}

{{ tdoc.title }}

  • {{ _('Rule') }}: {{ _(model.contest.RULES[tdoc['rule']].TEXT) }}
  • {{ _('Start at') }}: {{ contest.render_time(tsdoc.startAt or tdoc.beginAt) }}
  • {{ _('Duration') }}: {{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}
  • {{ _('Partic.') }}: {{ tdoc['attend']|default(0) }}
{{ _('View Details') }}
{% if tsdict[tdoc.docId].attend %}

{{ _('Attended') }}

{% else %}

{{ _('Not Attended') }}

{% endif %}
{% endmacro %} {% block content %}
{%- for tdoc in tdocs -%} {% if model.contest.isOngoing(tdoc, tsdoc) %} {{ render_important_contest('live', 'Live...', tdoc) }} {% elif model.contest.isUpcoming(tdoc) %} {{ render_important_contest('ready', 'Ready (☆▽☆)', tdoc) }} {% endif %} {%- endfor -%}

{{ _('All Contests') if not rule else _('All {0} Contests').format(_(model.contest.RULES[rule].TEXT)) }}

{{ _('Show') }}:
{% if not tdocs.length %} {{ nothing.render('There are no contests...') }} {% else %}
    {%- for tdoc in tdocs -%}
  1. {{ datetimeSpan(tdoc['beginAt'], false, 'D')|safe }}
    {{ datetimeSpan(tdoc['beginAt'], false, 'YYYY-M')|safe }}

    {{ tdoc.title }}

    • {{ _(model.contest.RULES[tdoc.rule].TEXT) }}
    • {% if tdoc.rated %}
    • Rated
    • {% endif %}
    • {{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}
    • {{ tdoc['attend']|default(0) }}
    • {% if tsdict[tdoc.docId].attend %}
    • {{ _('Attended') }}
    • {% endif %}
  2. {%- endfor -%}
{{ paginator.render(page, tpcount, add_qs=qs) }} {% endif %}
{% if handler.user.hasPerm(perm.PERM_CREATE_CONTEST) %}

{{ _('Create Contest') }}

{% endif %}
{% endblock %}