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.                 {{ component('avatar', {
  33.                     ptsOrName : (ptsThisWeek is defined and warmup is defined and warmup) ? ptsThisWeek : security().user.firstname|capitalize,
  34.                     mode : 'light',
  35.                     on : {
  36.                         click : {
  37.                             target : '.js-dialog-menu-account',
  38.                             event : 'open'
  39.                         }
  40.                     }
  41.                 }) }}
  42.             </div>
  43.         {% endif %}
  44.     {% if logout|default(false) and is_granted('ROLE_PRO') %}
  45.         <div class="header-app-right">
  46.             <a class="link mod-user mod-link" href="{{ path('account_logout') }}">Déconnexion</a>
  47.         </div>
  48.     {% endif %}
  49. </header>
  50. {% if logout|default(false) %}
  51.     {{ component('dialog-menu', {
  52.         title :security().user ? (security().user.firstname ? security().user.firstname|capitalize : (security().user.name ? security().user.name|capitalize : '')) : '',
  53.         class : 'js-dialog-menu-account',
  54.         links : [
  55.             {
  56.                 href : path('admin_home'),
  57.                 text : 'Administration',
  58.                 if : is_granted('ROLE_ADMIN')
  59.             },
  60.             '<span class="u-margin-bottom"></span>',
  61.             {
  62.                 href : path('warmupLog_index'),
  63.                 text : 'Points d\'échauffement',
  64.                 if : is_granted('ROLE_USER') and (warmup is defined and warmup)
  65.             },
  66.             (is_granted('ROLE_USER') and (warmup is defined and warmup)) ? '<span class="u-margin-bottom"></span>' : "",
  67.             {
  68.                 href : path('app_account_params_user_account'),
  69.                 text : 'Mon compte',
  70.             },
  71.             '<span class="u-margin-bottom"></span>',
  72.             {
  73.                 href : path('account_logout'),
  74.                 text : 'Déconnexion'
  75.             }
  76.         ]
  77.     }) }}
  78. {% endif %}