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

<header class="page-header page-header-profile has-nav {{ pageHeaderThemeClass is defined ? pageHeaderThemeClass : 'bg-tundora' }}{% if pageHeaderPicture is defined and pageHeaderPicture is not empty %} has-bg-image{% endif %}" {% if pageHeaderPicture is defined and pageHeaderPicture is not empty %}style="{{ pageHeaderPicture }}"{% endif %}>
    <div class="container">
        <div class="item-content">
            <div class="row">
                <div class="col-md-4 col-lg-2">
                    <div class="photo-badge" {% if app.user.photo is not empty %}style="background-image: url({{ app.user.getWebPhoto|imagine_filter('150Lx150H')|replace({' ' : '%20'}) }})"{% endif %}>
                        {% if app.user.photo is empty %}
                            {{ include('Front/_component/icon.html.twig', {id: 'user--user', class:'icon-profile-default'}) }}
                        {% endif %}
                    </div>
                </div>
                <div class="col-md-8 col-lg-10">
                    {# <a class="link float-right" href="{{ path('fos_user_security_logout') }}">Déconnexion</a> #}
                    <p class="username">{{ app.user.firstname  ~ ' ' ~ app.user.lastname }}</p>
                    <p class="text-small">
                        {% if app.user.type == constUserTypeInge %}
                            {% if app.user.categoryJob is not empty %}{{ app.user.categoryJob|transconst('AppBundle\\Enum\\UserJobEngineerCategory') }} / {% endif %}{{ app.user.job|transconst('AppBundle\\Enum\\UserJobEngineer') }} / {{ app.user.jobOther }}
                        {% elseif app.user.type == constUserTypeProf %}
                        {% if app.user.categoryJob is not empty %}{{ app.user.categoryJob|transconst('AppBundle\\Enum\\UserJobTeacherCategory') }} / {% endif %}{% if app.user.jobOther is not empty %}{{ ('word.' ~ app.user.type ~ '.label')|trans([], 'word') }} : {{ app.user.jobOther }}{% else %}{{ app.user.job|transconst('AppBundle\\Enum\\UserJobTeacher') }}{% endif %}
                        {% endif %}
                    </p> 
                    <br/>
                    {% if app.user.type == constUserTypeInge %}{% include "Front/_component/toggle_availability.html.twig" %}{% endif %} 
                </div>
            </div>
        </div>
        <ul class="no-style nav nav-tabs nav-justified justify-content-center">
            {% if app.user.type == constUserTypeInge %}
            <li class="nav-item">
                <a class="nav-link{% if pageHeaderActiveMenu == 'operations' %} active{% endif %}" href="{{ path('espace_perso_operations') }}"><span>{{ ('menu.espace_perso.header.' ~ app.user.type ~ '.operations')|trans([], 'menu') }}</span></a>
            </li>
            {#
            <li class="nav-item">
                <a class="nav-link{% if pageHeaderActiveMenu == 'demandes' %} active{% endif %}" href="{{ path('espace_perso_demandes') }}"><span>{{ ('menu.espace_perso.header.' ~ app.user.type ~ '.demandes')|trans([], 'menu') }}</span></a>
            </li>
            #}
            {% elseif app.user.type == constUserTypeProf %}
            <li class="nav-item">
                <a class="nav-link{% if pageHeaderActiveMenu == 'itdlc' %} active{% endif %}" href="{{ path('espace_perso_itdlc') }}"><span>{{ ('menu.espace_perso.header.' ~ app.user.type ~ '.itdlc')|trans([], 'menu') }}</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link{% if pageHeaderActiveMenu == 'pee' %} active{% endif %}" href="{{ path('espace_perso_pee') }}"><span>{{ ('menu.espace_perso.header.' ~ app.user.type ~ '.pee')|trans([], 'menu') }}</span></a>
            </li>
            {% endif %}
            <li class="nav-item">
                <a class="nav-link{% if pageHeaderActiveMenu == 'profile' %} active{% endif %}" href="{{ path('fos_user_profile_edit') }}"><span>{{ ('menu.espace_perso.header.' ~ app.user.type ~ '.profile')|trans([], 'menu') }}</span></a>
            </li>
        </ul>
    </div>
</header>