{% 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>
        <div>
            {% if user.absenceStart is not null %}
                <div class="alert alert-success flash_message">{{ 'absence.You are listed as absent, as of {date, date, short}'|trans({
                        date: user.absenceStart
                    }) }}
                    {% if user.absenceEnd is not null %}
                   {{ 'until %date%'|trans({'%date%': user.absenceEnd|format_date('short') }) }}
                {% endif %}
                </div>
            {% else %}
                <div class="alert alert-warning flash_message">{{ 'absence.No absence listed'|trans }}</div>
            {% endif %}
        </div>
        <div>
            {{ form_start(form) }}
            {{ form_row(form.absenceStart) }}
            {{ form_row(form.absenceEnd) }}

            <ul class="record_actions sticky-form-buttons">
                <li>
                    <a class="btn btn-delete" title="Modifier" href="{{ path('chill_main_user_absence_unset') }}">{{ 'absence.Unset absence'|trans }}</a>
                </li>
                <li>
                    <button class="btn btn-save" type="submit">
                        {{ 'Save'|trans }}
                    </button>
                </li>
            </ul>
            {{ form_end(form) }}
        </div>
    </div>

{% endblock %}
