{% extends "events/event_detail.html" %}
{% load i18n comments fieldset_extras %}

{% block title %}
{% if game.id %}{% trans "Edit Game" %}{% else %}{% trans "Add Game" %}{% endif %}
{% endblock %}

{% block maincontent %}
{% for error in form.errors %}<p class="error">{{error}}</p>{% endfor %}

{% for error in form.non_field_errors %}<p class="error">{{error}}</p>{% endfor %}

<form class="grid_12" method="post">
    {% csrf_token %}
    <fieldset>
        <legend>{% if game.id %}{% trans "Edit Game" %}{% else %} {% trans "Add Game" %}{% endif %}</legend>

        <p>
        <label for="id_player1" class="field_name {{ form.player1.css_classes }}">{{ form.player1.label }}</label>
        {{ form.player1 }}
        <label for="id_player1_score" class="{{ form.player1_score.css_classes }}">{{ form.player1_score.label }}</label>
        {{ form.player1_score}}
        </p>
        {% if form.player1.errors %}{{ form.player1.errors }}{% endif %}
        {% if form.player1_score.errors %}{{ form.player1_score.errors }}{% endif %}
        <p>
        <label for="id_player2" class="field_name {{ form.player2.css_classes }}">{{ form.player2.label }}</label>
        {{ form.player2 }}
        <label for="id_player2_score" class="{{ form.player2_score.css_classes }}">{{ form.player2_score.label }}</label>
        {{ form.player2_score}}
        </p>
        {% if form.player2.errors %}{{ form.player2.errors }}{% endif %}
        {% if form.player2_score.errors %}{{ form.player2_score.errors }}{% endif %}

        <p>
        <label for="id_player3" class="field_name {{ form.player3.css_classes }}">{{ form.player3.label }}</label>
        {{ form.player3 }}
        <label for="id_player3_score" class="{{ form.player3_score.css_classes }}">{{ form.player3_score.label }}</label>
        {{ form.player3_score}}
        </p>
        {% if form.player3.errors %}{{ form.player3.errors }}{% endif %}
        {% if form.player3_score.errors %}{{ form.player3_score.errors }}{% endif %}

        <p>
        <label for="id_player4" class="field_name {{ form.player4.css_classes }}">{{ form.player4.label }}</label>
        {{ form.player4 }}
        <label for="id_player4_score" class="{{ form.player4_score.css_classes }}">{{ form.player4_score.label }}</label>
        {{ form.player4_score}}
        </p>
        {% if form.player4.errors %}{{ form.player4.errors }}{% endif %}
        {% if form.player4_score.errors %}{{ form.player4_score.errors }}{% endif %}

        <p>
        <label for="id_player5" class="field_name {{ form.player5.css_classes }}">{{ form.player5.label }}</label>
        {{ form.player5 }}
        <label for="id_player5_score" class="{{ form.player5_score.css_classes }}">{{ form.player5_score.label }}</label>
        {{ form.player5_score}}
        </p>
        {% if form.player5.errors %}{{ form.player5.errors }}{% endif %}
        {% if form.player5_score.errors %}{{ form.player5_score.errors }}{% endif %}

        <p>
        <label for="id_player6" class="field_name {{ form.player6.css_classes }}">{{ form.player6.label }}</label>
        {{ form.player6 }}
        <label for="id_player6_score" class="{{ form.player6_score.css_classes }}">{{ form.player6_score.label }}</label>
        {{ form.player6_score}}
        </p>
        {% if form.player6.errors %}{{ form.player6.errors }}{% endif %}
        {% if form.player6_score.errors %}{{ form.player6_score.errors }}{% endif %}

        <p>
        <label for="id_comment" class="field_name {{ form.comment.css_classes }}">{{ form.comment.label }}</label>
        {{ form.comment }}
        </p>
        <p class="buttonbar">
            <a href="{% url 'maistar-game-list' game.event.pk %}" class="button"><span class="fa fa-undo"></span> {% trans 'Back' %}</a>
            <button type="submit"><span class="fa fa-hdd-o"></span> {% trans 'Save' %}</button>
        </p>
    </fieldset>
</form>
{% endblock %}

{% block buttonbar %}{% endblock %}