{% extends 'base.html.twig' %}

{% block title %}
    {% if omluvenka == 2 %}
        Suplování
    {% elseif omluvenka == 1 %}
        Omluvenka
    {% else %}
        Docházka
    {% endif %}
{% endblock %}

{% block body %}

    {% for message in app.flashes('danger') %}

        <div class="alert alert-danger">
            {{ message }}
        </div>

    {% endfor %}
    {% if omluvenka == 2 %}
        <h3 class="h3 card-title mb-3 font-weight-normal">Suplování</h3>
    {% else %}
        {% if predmet == null %}
            <h3 class="h3 card-title mb-3 font-weight-normal">Absence</h3>
        {% else %}
            <h3 class="h3 card-title mb-3 font-weight-normal">Absence - {{ predmet }}</h3>
        {% endif %}
    {% endif %}


    <hr>

    {{ form_start(form) }}

    <div class="input-group mb-3 justify-content-center">
        <label class="btn btn-outline-primary">
            {{ form_widget(form.chybi) }}
        </label>
    </div>

    <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">Jméno: </span>
        </div>
        {% if omluvenka == 2 %}
            {{ form_widget(form.ucitel) }}
        {% else %}
            {{ form_widget(form.zak) }}
        {% endif %}
    </div>

    <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">Datum: </span>
        </div>
        {{ form_widget(form.datum) }}
    </div>

    <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">Čas: </span>
        </div>
        {{ form_widget(form.doba) }}
    </div>

    {% if omluvenka == 1 %}

        <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">Omluvenka: </span>
        </div>
        {{ form_widget(form.poznamka) }}
        </div>

    {% elseif omluvenka == 2 %}

        <div class="input-group mb-3">
            <div class="input-group-prepend">
                <span class="input-group-text">Suplující učitel: </span>
            </div>
            {{ form_widget(form.supl_ucitel) }}
        </div>

    {% endif %}

    <hr>

    {{ form_widget(form.save) }}

{{ form_start(form) }}

{% endblock %}