{% extends '@ChillMain/Admin/layout.html.twig' %}

{% block title %}
    {{ 'absence.My absence'|trans }}
{% endblock title %}

{% block content %}

    <div class="col-md-10">
        <h2>{{ 'absence.My absence'|trans }}</h2>

        {% if user.absenceStart is not null %}
            <div>
                <p>{{ 'absence.You are listed as absent, as of'|trans }} {{ user.absenceStart|format_date('long') }}</p>
                <ul class="record_actions sticky-form-buttons">
                    <li>
                        <a href="{{ path('chill_main_user_absence_unset') }}"
                           class="btn btn-delete">{{ 'absence.Unset absence'|trans }}</a>
                    </li>
                </ul>
            </div>
        {% else %}
            <div>
                <p class="chill-no-data-statement">{{ 'absence.No absence listed'|trans }}</p>
            </div>
            <div>
                {{ form_start(form) }}
                {{ form_row(form.absenceStart) }}

                <ul class="record_actions sticky-form-buttons">
                    <li>
                        <button class="btn btn-save" type="submit">
                            {{ 'Save'|trans }}
                        </button>
                    </li>
                </ul>

                {{ form_end(form) }}
            </div>
        {% endif %}
    </div>

{% endblock %}
