components/header/header.twig line 1

Open in your IDE?
  1. {#
  2.     returnLink : lien de retour, si absent, logo recovup, renvoit vers "/"
  3.     returnLinkTitle : titre du lien de retour
  4.     class : liste des classes à appliquer
  5. #}
  6. {% set returnLink = returnLink is not defined ? "" : returnLink %}
  7. {% if "/admin/" in app.request.requestUri %}
  8.     {% if class is defined  %}
  9.         {% set adminClass = " mod-admin" %}
  10.     {% else %}
  11.         {% set adminClass = "mod-admin" %}
  12.     {% endif %}
  13. {% endif %}
  14. <header id="header" class="{{ class is defined ? class : "" }}{{ adminClass is defined ? adminClass : "" }}">
  15.     <nav>
  16.         <div>
  17.             {% if returnLink == "" %}
  18.                 <a href="/">
  19.                     <img id="logo" src="/img/logo/recovup.svg" alt="Recov'up">
  20.                 </a>
  21.             {% else %}
  22.             {% if
  23.             'recommandation' in app.request.pathInfo
  24.             and app.request.pathInfo != "/bienEtre/recommandation/"
  25.             %}
  26.                 {% set returnLink = path("bienEtre_recommandation_index") %}
  27.                 {% set returnLinkTitle = "Recommandation" %}
  28.             {% endif %}
  29.                 <a
  30.                     href="{{ returnLink }}"
  31.                     {% if returnLinkTitle is defined %} title="{{ returnLinkTitle }}" {% endif %}>
  32.                     <img src="/img/icons/v2/Retour.svg" alt="Retour">
  33.                 </a>
  34.             {% endif %}
  35.         </div>
  36.         <div>
  37.             {% if title is not defined %}
  38.                 {% if is_granted('ROLE_ADMIN') %}
  39.                     <a href="{{ path('admin_home') }}">
  40.                         <img src="/img/icons/v2/Admin.svg" alt="Admin">
  41.                     </a>
  42.                 {% endif %}
  43.                 <a href="{{ path('app_account_params_user_account') }}">
  44.                     <img src="/img/icons/v2/Profil.svg" alt="Profil">
  45.                 </a>
  46.                 <a href="/" class="js-notification-activation-btn notification-activation mod-hidden">
  47.                     <img src="/img/icons/v2/Cloche.svg" alt="Notification">
  48.                 </a>
  49.                 <a href="{{ path('warmupLog_index') }}">
  50.                     <img src="/img/icons/v2/Flamme.svg" alt="Admin">
  51.                 </a>
  52.             {% endif %}
  53.             {% if title is defined %}
  54.                 <h1>{{ title }}</h1>
  55.             {% endif %}
  56.         </div>
  57.     </nav>
  58. </header>