<header class="header-app-container {{ logout|default(false) ? 'mod-connected' }}">
{% if security().user != null %}
{% if returnUrl|default(false) %}
<div class="header-app-left">
<a class="link mod-arrow-left mod-link" href="{{ returnUrl }}" title="Retour">Retour</a>
</div>
{% elseif app.request.get('_route') != 'pro_home' and app.request.get('_route') != 'app' %}
<div class="header-app-left">
{% if accueilLink is defined %}
<a class="link mod-arrow-left mod-link" href="/{{ accueilLink }}" title="Accueil">Accueil</a>
{% else %}
<a class="link mod-arrow-left mod-link" href="/" title="Accueil">Accueil</a>
{% endif %}
</div>
{% endif %}
{% endif %}
<div class="header-app-center">
<a href="/" title="Accueil">
<img class="header-app-logo" src="/img/logo/recovup.svg" alt="Recov'up">
</a>
{% if subTitle|default(false) %}
<div class="header-app-subtitle">{{ subTitle }}</div>
{% endif %}
{% if capitalizeTitle is not defined or capitalizeTitle is same as(true) %}
<h1 class="header-app-maintitle">{{ title|capitalize }}</h1>
{% else %}
<h1 class="header-app-maintitle">{{ title }}</h1>
{% endif %}
</div>
{% if logout|default(false) and is_granted("ROLE_USER") %}
<div class="header-app-right">
{% if not is_granted('ROLE_ADMIN') %}
<div id="notification-permission"></div>
{% endif %}
{{ component('avatar', {
ptsOrName : (ptsThisWeek is defined and warmup is defined and warmup) ? ptsThisWeek : security().user.firstname|capitalize,
mode : 'light',
on : {
click : {
target : '.js-dialog-menu-account',
event : 'open'
}
}
}) }}
</div>
{% endif %}
{% if logout|default(false) and is_granted('ROLE_PRO') %}
<div class="header-app-right">
<a class="link mod-user mod-link" href="{{ path('account_logout') }}">Déconnexion</a>
</div>
{% endif %}
</header>
{% if logout|default(false) %}
{{ component('dialog-menu', {
title :security().user ? (security().user.firstname ? security().user.firstname|capitalize : (security().user.name ? security().user.name|capitalize : '')) : '',
class : 'js-dialog-menu-account',
links : [
{
href : path('admin_home'),
text : 'Administration',
if : is_granted('ROLE_ADMIN')
},
'<span class="u-margin-bottom"></span>',
{
href : path('warmupLog_index'),
text : 'Points d\'échauffement',
if : is_granted('ROLE_USER') and (warmup is defined and warmup)
},
(is_granted('ROLE_USER') and (warmup is defined and warmup)) ? '<span class="u-margin-bottom"></span>' : "",
{
href : path('app_account_params_user_account'),
text : 'Mon compte',
},
'<span class="u-margin-bottom"></span>',
{
href : path('account_logout'),
text : 'Déconnexion'
}
]
}) }}
{% endif %}