templates/partial/_header.html.twig line 1

Open in your IDE?
  1. <header class="r-header" role="header">
  2.     <section class="r-top">
  3.         <div class="r-top__wrap">
  4.             <ul class="r-top__nav">
  5.                 {% if is_granted('IS_IMPERSONATOR') %}
  6.                     <li><a href="{{ path('app_admin_comptes', {_switch_user: '_exit'}) }}" class="r-top__item1" style="color: #51a3a3;">[Quitter l'imitation]</a></li>
  7.                 {% endif %}
  8.                 {% if app.user %}
  9.                     {# <li><a href="https://www.srdi.net/actualites" class="r-top__item1" target="_blank">Actualités</a></li> #}
  10.                     {% if is_granted('ROLE_ADMIN') %}
  11.                         <li class="r-top__item1">
  12.                             <a href="{{ path('app_admin_ariane') }}" style="color: white;">Administration</a>
  13.                         </li>
  14.                     {% elseif is_granted('ROLE_USER') or is_granted('ROLE_SUPER_CLIENT') %}
  15.                         <li class="r-top__item1">
  16.                             <a class="r-top__item1" href="{{ path('app_client_commandes') }}" style="color: white;">
  17.                                 {% if app.user %}
  18.                                     <span class="fas fa-user"></span>
  19.                                     {{ app.user.enseigne }}
  20.                                     {% if app.user.nom is not null and app.user.prenom is not null %}
  21.                                         - {{ app.user.prenom }} {{ app.user.nom }}
  22.                                     {% endif %}
  23.                                 {% endif %}
  24.                             </a>
  25.                         </li>
  26.                         <li><a href="{{ path('app_page_contact') }}" class="r-top__item1">Contact</a></li>
  27.                         <li class="togglePanier">
  28.                             <a href="{{ path('app_client_panier') }}" class="r-top__item1 r-top__panier">
  29.                                 <svg class="r-top__panierIco"><use xlink:href="#cadi"></use></svg>
  30.                                 <span class="r-top__panierNbr">{{ nbArticlePanier }}</span>
  31.                             </a>
  32.                             {% if app.user and is_granted('ROLE_USER') or is_granted('ROLE_SUPER_CLIENT') %}
  33.                                 {% include "partial/_panier.html.twig" %}
  34.                             {% endif %}
  35.                         </li>
  36.                     {% endif %}
  37.                 {% else %}
  38.                     {# <li><a href="https://www.srdi.net/actualites" class="r-top__item1" target="_blank">Actualités</a></li> #}
  39.                     <li><a href="{{ path('app_page_contact') }}" class="r-top__item1">Contact</a></li>
  40.                     <li><a href="{{ path('app_login') }}" class="r-top__item1">Se connecter</a></li>
  41.                 {% endif %}
  42.             </ul>
  43.         </div>
  44.     </section>
  45.     <section class="r-header__wrap">
  46.         <a href="/" class="r-header__home">
  47.             <svg class="r-header__logo">
  48.                 <use xlink:href="#logo"></use>
  49.             </svg>
  50.         </a>
  51.         {% if app.user %}
  52.             {% set cat1 = true %}
  53.             {% set cat2 = true %}
  54.             {% set cat3 = true %}
  55.             {% for restriction in restrictionCategorie %}
  56.                 {% if restriction == 1 %}
  57.                     {% set cat1 = false %}
  58.                 {% endif %}
  59.                 {% if restriction == 2 %}
  60.                     {% set cat2 = false %}
  61.                 {% endif %}
  62.                 {% if restriction == 3 %}
  63.                     {% set cat3 = false %}
  64.                 {% endif %}
  65.             {% endfor %}
  66.             <ul class="r-header__nav">
  67.                 <li class="r-header__item1">
  68.                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC'}) }}" style="color: white; text-decoration: none;">Produits</a>
  69.                     <svg class="r-header__chevron">
  70.                         <use xlink:href="#chevron-down"></use>
  71.                     </svg>
  72.                     <ul class="r-header__subnav">
  73.                         <li>
  74.                             <ul 
  75.                                 {% 
  76.                                     if (
  77.                                         clientGroupe not in brother.clientGroupes
  78.                                         and clientGroupe not in canon.clientGroupes
  79.                                         and clientGroupe not in epson.clientGroupes
  80.                                         and clientGroupe not in hp.clientGroupes
  81.                                     ) and (
  82.                                         brother.isVisibleAriane == true
  83.                                         or canon.isVisibleAriane == true
  84.                                         or epson.isVisibleAriane == true
  85.                                         or hp.isVisibleAriane == true
  86.                                     )
  87.                                 %}
  88.                                     class="r-header__navprod"
  89.                                 {% endif %}
  90.                             >
  91.                                 <li class="r-header__navprod--left">
  92.                                     {% 
  93.                                         if cat1 == true and (
  94.                                             clientGroupe not in brother.clientGroupes
  95.                                             and clientGroupe not in canon.clientGroupes
  96.                                             and clientGroupe not in epson.clientGroupes
  97.                                             and clientGroupe not in hp.clientGroupes
  98.                                         ) and (
  99.                                             brother.isVisibleAriane == true
  100.                                             or canon.isVisibleAriane == true
  101.                                             or epson.isVisibleAriane == true
  102.                                             or hp.isVisibleAriane == true
  103.                                         )
  104.                                     %}
  105.                                         <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE COMPATIBLE'}) }}"
  106.                                             class="r-header__link">
  107.                                             <span class="r-header__title">Encre compatible <br><small>(Print3E)</small></span>
  108.                                         </a>
  109.                                         <ul class="r-header__leftnav">
  110.                                             {% if 
  111.                                                 clientGroupe not in brother.clientGroupes 
  112.                                                 and brother.isVisibleAriane == true
  113.                                             %}
  114.                                                 <li class="r-header__finalitems">
  115.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE COMPATIBLE', 'gamme[]': 'Brother'}) }}"
  116.                                                         class="r-header__link">
  117.                                                         <span class="r-header__subtitle">Brother</span>
  118.                                                     </a>
  119.                                                 </li>
  120.                                             {% endif %}
  121.                                             {% if 
  122.                                                 clientGroupe not in canon.clientGroupes 
  123.                                                 and canon.isVisibleAriane == true
  124.                                             %}
  125.                                                 <li class="r-header__finalitems">
  126.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE COMPATIBLE', 'gamme[]': 'Canon'}) }}"
  127.                                                         class="r-header__link">
  128.                                                         <span class="r-header__subtitle">Canon</span>
  129.                                                     </a>
  130.                                                 </li>
  131.                                             {% endif %}
  132.                                             {% if 
  133.                                                 clientGroupe not in epson.clientGroupes 
  134.                                                 and epson.isVisibleAriane == true
  135.                                             %}
  136.                                                 <li class="r-header__finalitems">
  137.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE COMPATIBLE', 'gamme[]': 'Epson'}) }}"
  138.                                                         class="r-header__link">
  139.                                                         <span class="r-header__subtitle">Epson</span>
  140.                                                     </a>
  141.                                                 </li>
  142.                                             {% endif %}
  143.                                             {% if 
  144.                                                 clientGroupe not in hp.clientGroupes 
  145.                                                 and hp.isVisibleAriane == true
  146.                                             %}
  147.                                                 <li class="r-header__finalitems">
  148.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE COMPATIBLE', 'gamme[]': 'HP'}) }}"
  149.                                                         <span class="r-header__subtitle">HP</span>                                            
  150.                                                     </a>
  151.                                                 </li>
  152.                                             {% endif %}
  153.                                         </ul>
  154.                                     {% endif %}
  155.                                     
  156.                                     {% 
  157.                                         if cat2 == true and (
  158.                                             clientGroupe not in canon.clientGroupes
  159.                                             and clientGroupe not in epson.clientGroupes
  160.                                             and clientGroupe not in hp.clientGroupes
  161.                                         ) and (
  162.                                             canon.isVisibleAriane == true
  163.                                             or epson.isVisibleAriane == true
  164.                                             or hp.isVisibleAriane == true
  165.                                         )
  166.                                     %}
  167.                                         <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE OEM'}) }}"
  168.                                             class="r-header__link">
  169.                                             <span class="r-header__title" style="margin-top: 2rem;">Encre OEM</span>
  170.                                         </a>
  171.                                         <ul class="r-header__leftnav">
  172.                                             {% if 
  173.                                                 clientGroupe not in canon.clientGroupes 
  174.                                                 and canon.isVisibleAriane == true
  175.                                             %}
  176.                                                 <li class="r-header__finalitems">
  177.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE OEM', 'marque[]': 'CANON'}) }}"
  178.                                                         class="r-header__link">
  179.                                                         <span class="r-header__subtitle">Canon</span>
  180.                                                     </a>
  181.                                                 </li>
  182.                                             {% endif %}
  183.                                             {% if 
  184.                                                 clientGroupe not in epson.clientGroupes 
  185.                                                 and epson.isVisibleAriane == true
  186.                                             %}
  187.                                                 <li class="r-header__finalitems">
  188.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE OEM', 'marque[]': 'EPSON'}) }}"
  189.                                                         class="r-header__link">
  190.                                                         <span class="r-header__subtitle">Epson</span>
  191.                                                     </a>
  192.                                                 </li>
  193.                                             {% endif %}
  194.                                             {% if 
  195.                                                 clientGroupe not in hp.clientGroupes 
  196.                                                 and hp.isVisibleAriane == true
  197.                                             %}
  198.                                                 <li class="r-header__finalitems">
  199.                                                     <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ENCRE OEM', 'marque[]': 'HP'}) }}"
  200.                                                         class="r-header__link">
  201.                                                         <span class="r-header__subtitle">HP</span>
  202.                                                     </a>
  203.                                                 </li>
  204.                                             {% endif %}
  205.                                         </ul>
  206.                                     {% endif %}
  207.                                 </li>
  208.                                 <li>
  209.                                     {% if cat3 == true %}
  210.                                         <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ACCESSOIRE'}) }}"
  211.                                             <span class="r-header__title">Accessoire</span>
  212.                                         </a>
  213.                                         <ul class="r-header__undernav">
  214.                                             {% for menu, sousMenus in accessoireMenus %}
  215.                                                 <li class="r-header__finalitems">
  216.                                                     <span class="r-header__subtitle">{{ menu }}</span>
  217.                                                     <ul class="r-header__subundernav">
  218.                                                         {% for sousMenu in sousMenus %}
  219.                                                             <li class="r-header__">
  220.                                                                 <a href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'categorie[]': 'ACCESSOIRE', 'gamme[]': sousMenu|upper, 'famille[]': menu|upper}) }}"
  221.                                                                     class="r-header__link">
  222.                                                                     {{ sousMenu }}
  223.                                                                 </a>
  224.                                                             </li>
  225.                                                         {% endfor %}
  226.                                                     </ul>
  227.                                                 </li>
  228.                                             {% endfor %}
  229.                                         </ul>
  230.                                     {% endif %}
  231.                                 </li>
  232.                             </ul>
  233.                         </li>
  234.                     </ul>
  235.                 </li>
  236.                 <li class="r-header__item1">Marques
  237.                     <svg class="r-header__chevron">
  238.                         <use xlink:href="#chevron-down"></use>
  239.                     </svg>
  240.                     <ul class="r-header__subnav">
  241.                         <li>
  242.                             <ul class="r-header__navprod">
  243.                                 <li class="r-header__navprod--left">
  244.                                     {# MARQUE PRIORITAIRE #}
  245.                                     {% if marquesPrioritaires is not null and marquesPrioritaires|length > 0 %}
  246.                                         <a class="r-header__link"><span class="r-header__title">Nos marques</span></a>
  247.                                         <ul class="r-header__leftnav" style="margin-bottom: 2rem;">
  248.                                             {% for marquePrioritaire in marquesPrioritaires %}
  249.                                                 <li class="r-header__finalitems">
  250.                                                     <a class="r-header__subtitle" href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'marque[]': marquePrioritaire.nom|upper}) }}">
  251.                                                         {{ marquePrioritaire.nom }}                       
  252.                                                     </a>
  253.                                                 </li>
  254.                                             {% endfor %}
  255.                                         </ul>
  256.                                     {% endif %}
  257.                                     {# MARQUE COMPATIBLE #}
  258.                                     {% if marquesCom is not null and marquesCom|length > 0 %}
  259.                                         <a class="r-header__link"><span class="r-header__title">Marque compatible</span></a>
  260.                                         <ul class="r-header__leftnav" style="margin-bottom: 2rem;">
  261.                                             {% for marqueCom in marquesCom %}
  262.                                                 <li class="r-header__finalitems">
  263.                                                     <a class="r-header__subtitle" href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'marque[]': marqueCom.nom|upper}) }}">
  264.                                                         {{ marqueCom.nom }}
  265.                                                     </a>
  266.                                                 </li>
  267.                                             {% endfor %}
  268.                                         </ul>
  269.                                     {% endif %}
  270.                                     {# MARQUE OEM #}
  271.                                     {% if marquesOem is not null and marquesOem|length > 0 %}
  272.                                         <a class="r-header__link"><span class="r-header__title">Marque Oem</span></a>
  273.                                         <ul class="r-header__leftnav">
  274.                                             {% for marqueOem in marquesOem %}
  275.                                                 <li class="r-header__finalitems">
  276.                                                     <a class="r-header__subtitle" href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'marque[]': marqueOem.nom|upper}) }}">
  277.                                                         {{ marqueOem.nom }}
  278.                                                     </a>
  279.                                                 </li>
  280.                                             {% endfor %}
  281.                                         </ul>
  282.                                     {% endif %}
  283.                                 </li>
  284.                                 
  285.                                 {# MARQUE ACCESSOIRE #}
  286.                                 <li>
  287.                                     <a class="r-header__link"><span class="r-header__title">Marque accessoire</span></a>
  288.                                     <ul class="r-header__undernav r-header__undernav--marque">
  289.                                         {% for marqueAcc in marquesAcc %}
  290.                                             <li class="r-header__finalitems">
  291.                                                 <a class="r-header__subtitle" href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'marque[]': marqueAcc.nom|upper}) }}">
  292.                                                     {{ marqueAcc.nom }}
  293.                                                 </a>
  294.                                             </li>
  295.                                         {% endfor %}
  296.                                     </ul>
  297.                                 </li>
  298.                             </ul>
  299.                         </li>
  300.                     </ul>
  301.                 </li>
  302.                 <li>
  303.                     <a class="r-header__item1" href="{{ path('app_page_recherche', {'search': '', 'prix': 'HT', 'sort': 'ASC', 'statut[]': 'NEW'}) }}">Nouveautés</a>
  304.                 </li>
  305.                 <li>
  306.                     <a class="r-header__item1" href="{{ path('app_page_promotions') }}">Promotions</a>
  307.                 </li>
  308.                 {% if indispensables %}
  309.                     <li>
  310.                         <a class="r-header__item1" href="{{ path('app_page_indispensables') }}">Indispensables</a>
  311.                     </li>
  312.                 {% endif %}
  313.                 {% if affichageBonsPlansWeb %}
  314.                     <li>
  315.                         <a class="r-header__item1 r-header__item1--promo" href="{{ path('app_page_bons_plans_web') }}">Destockage</a>
  316.                     </li>                
  317.                 {% endif %}
  318.                 <li>
  319.                     <form class="s-search__form" action="{{ path('app_page_recherche') }}" data-controller="search" data-search-url-value="{{ path('references_autocompletion') }}">
  320.                         <input type="hidden" name="sort" id="sort" value='ASC'> {# par defaut #}
  321.                         <input type="hidden" name="prix" id="prix" value='HT'> {# par defaut #}
  322.                         <input list="rechercheProduits" class="s-search__input" name="search" placeholder="EAN ou mots clés" id="datalistRechercheProduits" 
  323.                             data-search-target="input" data-action="focus->search#search input->search#accents"/>
  324.                         <datalist id="rechercheProduits" data-search-target="datalist">
  325.                         </datalist>
  326.                         <button class="s-search__btn" type="submit">
  327.                             <svg class="s-showcase__tabIco"><use xlink:href="#loupe"></use></svg>
  328.                         </button> 
  329.                     </form>
  330.                 </li>
  331.             </ul>
  332.         {% endif %}
  333.     </section>
  334. </header>