templates/_partials/app.html.twig line 1

Open in your IDE?
  1. <header class="header-app-container {{ logout|default(false) ? 'mod-connected' }}">
  2.     {% if security().user != null %}
  3.         {% if returnUrl|default(false) %}
  4.             <div class="header-app-left">
  5.                 <a class="link mod-arrow-left mod-link" href="{{ returnUrl }}" title="Retour">Retour</a>
  6.             </div>
  7.         {% elseif app.request.get('_route') != 'pro_home' and app.request.get('_route') != 'app' %}
  8.             <div class="header-app-left">
  9.                 {% if accueilLink is defined %}
  10.                     <a class="link mod-arrow-left mod-link" href="/{{ accueilLink }}" title="Accueil">Accueil</a>
  11.                 {% else %}
  12.                     <a class="link mod-arrow-left mod-link" href="/" title="Accueil">Accueil</a>
  13.                 {% endif %}
  14.             </div>
  15.         {% endif %}
  16.     {% endif %}
  17.     <div class="header-app-center">
  18.         <a href="/" title="Accueil">
  19.             <img class="header-app-logo" src="/img/logo/recovup.svg" alt="Recov'up">
  20.         </a>
  21.         {% if subTitle|default(false) %}
  22.             <div class="header-app-subtitle">{{ subTitle }}</div>
  23.         {% endif %}
  24.         {% if capitalizeTitle is not defined or capitalizeTitle is same as(true) %}
  25.             <h1 class="header-app-maintitle">{{ title|capitalize }}</h1>
  26.         {% else %}
  27.             <h1 class="header-app-maintitle">{{ title }}</h1>
  28.         {% endif %}
  29.     </div>
  30.     {% if logout|default(false) and is_granted("ROLE_USER") %}
  31.         <div class="header-app-right">
  32.             {% if not is_granted('ROLE_ADMIN') %}
  33.                 <div id="notification-permission"></div>
  34.             {% endif %}
  35.             {{ component('avatar', {
  36.                 ptsOrName : (ptsThisWeek is defined and warmup is defined and warmup) ? ptsThisWeek : security().user.firstname|capitalize,
  37.                 mode : 'light',
  38.                 on : {
  39.                     click : {
  40.                         target : '.js-dialog-menu-account',
  41.                         event : 'open'
  42.                     }
  43.                 }
  44.             }) }}
  45.         </div>
  46.     {% endif %}
  47.     {% if logout|default(false) and is_granted('ROLE_PRO') %}
  48.         <div class="header-app-right">
  49.             <a class="link mod-user mod-link" href="{{ path('account_logout') }}">Déconnexion</a>
  50.         </div>
  51.     {% endif %}
  52. </header>
  53. {% if logout|default(false) %}
  54.     {{ component('dialog-menu', {
  55.         title :security().user ? (security().user.firstname ? security().user.firstname|capitalize : (security().user.name ? security().user.name|capitalize : '')) : '',
  56.         class : 'js-dialog-menu-account',
  57.         links : [
  58.             {
  59.                 href : path('admin_home'),
  60.                 text : 'Administration',
  61.                 if : is_granted('ROLE_ADMIN')
  62.             },
  63.             '<span class="u-margin-bottom"></span>',
  64.             {
  65.                 href : path('warmupLog_index'),
  66.                 text : 'Points d\'échauffement',
  67.                 if : is_granted('ROLE_USER') and (warmup is defined and warmup)
  68.             },
  69.             (is_granted('ROLE_USER') and (warmup is defined and warmup)) ? '<span class="u-margin-bottom"></span>' : "",
  70.             {
  71.                 href : path('app_account_params_user_account'),
  72.                 text : 'Mon compte',
  73.             },
  74.             '<span class="u-margin-bottom"></span>',
  75.             {
  76.                 href : path('account_logout'),
  77.                 text : 'Déconnexion'
  78.             }
  79.         ]
  80.     }) }}
  81. {% endif %}