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

{{ _(title) }}

{{ tdoc['title'] }}

  • {{ _('Rule') }}: {{ vj4.constant.contest.RULE_TEXTS[tdoc['rule']] }}
  • {{ _('Start at') }}: {{ contest.render_time(tdoc['begin_at']) }}
  • {{ _('Duration') }}: {{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}
  • {{ _('Partic.') }}: {{ tdoc['attend']|default(0) }}
{{ _('View Details') }}
{% if tsdict[tdoc['doc_id']]['attend'] == 1 %}

{{ _('Attended') }}

{% else %}

{{ _('Not Attended') }}

{% endif %}
{% endmacro %} {% block content %}
{% for tdoc in tdocs %} {% if handler.is_ongoing(tdoc) %} {{ render_important_contest('live', 'Live...', tdoc) }} {% elif handler.is_upcoming(tdoc) %} {{ render_important_contest('ready', 'Ready (☆▽☆)', tdoc) }} {% endif %} {% endfor %}

{% if not rule %}{{ _('All Contests') }}{% else %}{{ _('All {0} Contests').format(_(vj4.constant.contest.RULE_TEXTS[rule])) }}{% endif %}

{{ _('Show') }}:
{% if not tdocs %} {{ nothing.render('There are no contests...') }} {% else %}
    {% for tdoc in tdocs %}
  1. {{ datetime_span(tdoc['begin_at'], false, '%d') }}
    {{ datetime_span(tdoc['begin_at'], false, '%Y-%m') }}

    {{ tdoc['title'] }}

  2. {% endfor %}
{{ paginator.render(page, tpcount, add_qs=qs) }} {% endif %}
{% if handler.has_perm(perm.PERM_CREATE_CONTEST) %}

{{ _('Create Contest') }}

{% endif %}
{% endblock %}