templates/partials/generalHeader.html.twig line 1

  1. {% block laptopHeader %}
  2. <header
  3.   class="w-full navbar h-20 flex items-center sticky-header z-50 relative dark:bg-background dark:text-gray-100 transition-all"
  4. >
  5.   <nav class="container-menu mx-auto flex items-center justify-between lg:px-5 px-5">
  6.     <svg
  7.       xmlns="http://www.w3.org/2000/svg"
  8.       class="h-6 w-6 lg:hidden block menu-btn"
  9.       fill="none"
  10.       viewBox="0 0 24 24"
  11.       stroke="currentColor"
  12.       stroke-width="2"
  13.     >
  14.       <path
  15.         stroke-linecap="round"
  16.         stroke-linejoin="round"
  17.         d="M4 6h16M4 12h16M4 18h16"
  18.       />
  19.     </svg>
  20.     <div>
  21.       <a href="/" class="flex items-center">
  22.         <img class="w-auto h-12 mr-3" src="../img/bos_logo.png" alt="" />
  23.         <h6 class="text-base font-medium"></h6>
  24.       </a>
  25.     </div>
  26.     <button
  27.       type="button"
  28.       class="hover:text-blue-500 flex items-center lg:hidden"
  29.     >
  30.       {% set path = is_granted('ROLE_COMMERCE') or is_granted('ROLE_ADMIN') ? path('admin') : path('app_login') %}
  31.        <a href="{{ path }}">
  32.        <span class="lg:mr-3 mr-0 relative">
  33.         <img
  34.           class="w-8 h-8 rounded-full border border-white"
  35.           src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
  36.           alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
  37.         />
  38.               {% if app.user %}
  39.                   <span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
  40.               {% else %}
  41.                   <span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
  42.               {% endif %}
  43.       </span>
  44.       </a>
  45.     </button>
  46.     <div class="hidden lg:flex items-center">
  47.       <ul class="flex items-center">
  48.               <li class="">
  49.           <div
  50.   class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  51. >
  52.   <button class="link hover:text-blue-500 flex items-center">
  53.     <a href="{{ path('app_home_list') }}">Accéder à la carte</a>
  54.   </button>
  55.         <li class="">
  56.           <div
  57.   class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  58. >
  59.   <button class="link hover:text-blue-500 flex items-center">
  60.     Categories
  61.     <svg
  62.       data-dropdown-button
  63.       class="w-3 h-auto ml-2"
  64.       width="10"
  65.       height="6"
  66.       viewBox="0 0 10 6"
  67.       fill="none"
  68.       xmlns="http://www.w3.org/2000/svg"
  69.     >
  70.       <path
  71.         d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
  72.         fill="currentColor"
  73.       />
  74.     </svg>
  75.   </button>
  76.   <div class="absolute top-9 invisible opacity-0 whitespace-nowrap pt-0">
  77.     <div
  78.       class="rounded-lg whitespace-nowrap shadow-front-3 bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  79.     >
  80.       <ul
  81.         class="h-full rounded-lg relative bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  82.       >
  83.       <!-- ALL CATEGORIES IN MENU START -->
  84.       {% for category in categorieNavbar() %}
  85.         <li
  86.           class="flex rounded-t-lg [&>a_h6]:hover:text-blue-500 [&>a:first-child]:hover:border-blue-200 [&>a:first-child]:hover:rounded-t-lg [&>a:first-child]:hover:bg-blue-50 [&>a:last-child]:hover:block bg-white dark:bg-foreground"
  87.         >
  88.           <a
  89.             href="{{ path('app_home_list_category', {id:category.id}) }}"
  90.             class="link px-3 py-2 border-b text-sm border-grey-200 dark:border-gray-800 w-full"
  91.           >
  92.             <h6 class="font-medium text-gray-600 dark:text-gray-200">
  93.               {{category.name}}
  94.             </h6>
  95.             <p class="font-normal text-gray-500 dark:text-gray-400 text-xs">
  96.               {{category.subtitle}}
  97.             </p>
  98.           </a>
  99.         </li>
  100.         {% endfor %}
  101.         <!-- ALL CATEGORIES IN MENU END -->
  102.       </ul>
  103.     </div>
  104.   </div>
  105. </div>
  106.         </li>
  107.         <li class="">
  108. <div
  109.   class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  110. >
  111.   <button class="link hover:text-blue-500 flex items-center">
  112.     Blog
  113.     </svg>
  114.   </button>
  115.           </li>
  116.           <li class="">
  117. <div
  118.   class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  119. >
  120.   <button class="link hover:text-blue-500 flex items-center">
  121.     Nos valeurs
  122.     </svg>
  123.   </button>
  124. </li>
  125.         <li class="mr-9">
  126.           <svg
  127.             xmlns="http://www.w3.org/2000/svg"
  128.             class="h-5 w-5 text-gray-300 cursor-pointer darkMode"
  129.             viewBox="0 0 20 20"
  130.             fill="currentColor"
  131.           >
  132.             <path
  133.               d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
  134.             />
  135.           </svg>
  136.           <svg
  137.             xmlns="http://www.w3.org/2000/svg"
  138.             class="h-5 w-5 text-yellow-500 cursor-pointer lightMode hidden"
  139.             viewBox="0 0 20 20"
  140.             fill="currentColor"
  141.           >
  142.             <path
  143.               fill-rule="evenodd"
  144.               d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
  145.               clip-rule="evenodd"
  146.             />
  147.           </svg>
  148.         </li>
  149.  <li class="mr-9">
  150.           <div class="dropdown" data-dropdown>
  151.             <button
  152.               class="link hover:text-blue-500 flex items-center"
  153.               data-dropdown-button
  154.             >
  155.                 <img
  156.                   class="w-8 h-8 rounded-full border border-white mr-3"
  157.                   src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
  158.                   data-dropdown-button
  159.                   alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
  160.                 />
  161.               {% if app.user %}
  162.                   <span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
  163.               {% else %}
  164.                   <span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
  165.               {% endif %}
  166.               </span>
  167.               Espace professionnel
  168.               <svg
  169.                 class="w-3 h-auto ml-2"
  170.                 width="10"
  171.                 height="6"
  172.                 data-dropdown-button
  173.                 viewBox="0 0 10 6"
  174.                 fill="none"
  175.                 xmlns="http://www.w3.org/2000/svg"
  176.               >
  177.                 <path
  178.                   d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
  179.                   fill="currentColor"
  180.                 />
  181.               </svg>
  182.             </button>
  183.             <div
  184.               class="dropdown-menu bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  185.             >
  186.               <div>
  187.                 <div class="dropdown-links max-w-xs w-48 rounded-md py-3">
  188.                   
  189.                   {% set path = is_granted('ROLE_COMMERCE') or is_granted('ROLE_ADMIN') ? path('admin') : path('app_login') %}
  190.                   <a
  191.                     href="{{ path }}"
  192.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  193.                     ><svg
  194.                       xmlns="http://www.w3.org/2000/svg"
  195.                       class="w-4 h-4 mr-2"
  196.                       fill="none"
  197.                       viewBox="0 0 24 24"
  198.                       stroke="currentColor"
  199.                       stroke-width="2"
  200.                     >
  201.                       <path
  202.                         stroke-linecap="round"
  203.                         stroke-linejoin="round"
  204.                         d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
  205.                       /></svg
  206.                     >Mon compte
  207.                   </a>
  208.                   <a
  209.                     href="#"
  210.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  211.                   >
  212.                     <svg
  213.                       xmlns="http://www.w3.org/2000/svg"
  214.                       class="h-4 w-4 mr-2"
  215.                       fill="none"
  216.                       viewBox="0 0 24 24"
  217.                       stroke="currentColor"
  218.                       stroke-width="2"
  219.                     >
  220.                       <path
  221.                         stroke-linecap="round"
  222.                         stroke-linejoin="round"
  223.                         d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
  224.                       />
  225.                     </svg>
  226.                     Nos offres
  227.                   </a>
  228.                   {% if app.user %}
  229.                   <a
  230.                     href="{{ path('app_logout')}}"
  231.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  232.                   >
  233.                     <svg
  234.                       xmlns="http://www.w3.org/2000/svg"
  235.                       class="w-4 h-4 mr-2"
  236.                       fill="none"
  237.                       viewBox="0 0 24 24"
  238.                       stroke="currentColor"
  239.                       stroke-width="2"
  240.                     >
  241.                       <path
  242.                         stroke-linecap="round"
  243.                         stroke-linejoin="round"
  244.                         d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
  245.                       />
  246.                     </svg>
  247.                     Déconnexion
  248.                   </a>
  249.                   {% endif %}
  250.                 </div>
  251.               </div>
  252.             </div>
  253.           </div>
  254.         </li>
  255.       </ul>
  256.       <a href="{{ path('app_shop_new') }}">
  257.       <button
  258.         type="button"
  259.         class="inline-flex hover:bg-blue-500 hover:text-white items-center px-3 py-[9px] rounded-lg border hover:border-blue-100"
  260.       >
  261.         <svg
  262.           xmlns="http://www.w3.org/2000/svg"
  263.           class="h-4 w-4 xl:mr-2 mr-0"
  264.           viewBox="0 0 20 20"
  265.           fill="currentColor"
  266.         >
  267.           <path
  268.             fill-rule="evenodd"
  269.             d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
  270.             clip-rule="evenodd"
  271.           />
  272.         </svg>
  273.         <span class="xl:block hidden">Ajouter un commerce</span>
  274.       </button>
  275.       </a>
  276.     </div>
  277.   </nav>
  278. </header>
  279. {% endblock %}