{% extends "touchtechnology/admin/edit.html" %} {% load i18n %} {% load common %} {% block messages %} {{ block.super }} {% if formset.non_form_errors %}
    {{ formset.non_form_errors|unordered_list }}
{% endif %} {% endblock %} {% block content %}

{% trans "Schedule" %}

{% csrf_token %} {{ formset.management_form }} {% regroup formset.forms by instance.stage.division as grouped %}
{% for group in grouped %}
{{ group.grouper }} {% for form in group.list %} {% with match=form.instance %} {% with home=match.get_home_team away=match.get_away_team %}
{{ form.id }}
{{ match }}
{% field form.time %}
{% field form.play_at %}
{% endwith %} {% endwith %} {% endfor %}
{% endfor %}
 {% trans "Cancel" %}
{% endblock %} {% block main_content %}
{# FIXME: better construction of this heading to allow for translation #}

Schedule{% if division %} {{ division.title }}{% if stage %} ({{ stage.title }}){% endif %}{% endif %} - {{ date|date }}

{% csrf_token %} {{ formset.non_form_errors }} {% if formset.errors %} {# We are only here if it was not possible to validate the formset #}
{% for f in formset.management_form %} {% field f %} {% endfor %}
{% else %} {% for f in formset.management_form %} {{ f.as_hidden }} {% endfor %} {% endif %}
{% if not division %}{% endif %} {% if not round %}{% endif %} {% for form in formset.forms %} {% with match=form.instance %} {% with home=match.get_home_team away=match.get_away_team %} {% if not division %}{% endif %} {% if not round %}{% endif %} {% endwith %} {% endwith %} {% endfor %}
{% trans "Division" %}{% trans "Round" %}{% trans "Home team" %} {% trans "Away team" %} {% trans "Time" %} {% trans "Play at" %}
{{ match.stage.division.title }}{% if match.stage_group %} - {{ match.stage_group.title }}{% endif %}{{ match.round }}{{ home.title }} {{ away.title }} {{ form.id }}{% field form.time "" %} {% field form.play_at "" %}
{% trans "Cancel" %}
{% endblock %}