{% trans_default_domain 'FOSUserBundle' %}

{% form_theme form with ['Front/Form/fields.html.twig'] %}

{% set constUserTypeProf = constant('AppBundle\\Enum\\UserType::TEACHER') %}

<div class="form form-user-profile">
    <div class="info-system">
        {% for flashMessage in app.session.flashbag.get('info') %}<div class="info-system-text">{{ flashMessage }}</div>{% endfor %}
    </div>

    <a class="back highlighted" href="{{ path('espace_perso') }}">
        {{ include('Front/_component/icon.html.twig', {id: 'arrow--arrow-27'}) }}
        retour
    </a>

    <h2 class="form-title">Modifier mes informations</h2>

    {{ form_start(form, {attr: {class: 'form-user-profile-form'}}) }}
        <div class="form-information">
            <p>Tous les champs marqués d'une astérisque (<span class="required-help">*</span>) sont obligatoires.</p>
        </div>
        {{ form_row(form.username) }}
        {{ form_row(form.email) }}
        {{ form_row(form.honorific) }}
        {{ form_row(form.firstname) }}
        {{ form_row(form.lastname) }}
        {{ form_row(form.birthday) }}
        {{ form_row(form.phone) }}
        {{ form_row(form.mobile) }}
        {{ form_row(form.photoFile) }}

        {% if constUserTypeProf == app.user.type %}
            {{ form_row(form.job) }}
            {{ form_row(form.jobOther) }}
            {{ form_row(form.classroom) }}
        {% endif %}

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