templates/base.html.twig line 177

Open in your IDE?
  1. <!DOCTYPE html>
  2. {% set is_rtl = app.request.locale == 'ar_TN' %}
  3. <html lang="{{ is_rtl ? 'ar' : 'fr' }}" dir="{{ is_rtl ? 'rtl' : 'ltr' }}">
  4.   <head>
  5.     <meta charset="UTF-8" />
  6.     <title>
  7.       {% block title %}
  8.         Welcome!
  9.       {% endblock %}
  10.     </title>
  11.     <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>" />
  12.     {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
  13.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
  14.     <!-- Style -->
  15.     <link rel="stylesheet" href="{{ asset('css/style.css') }}" />
  16.     <link rel="stylesheet" href="{{ asset('css/style-login.css') }}" />
  17.     <link href="https://unpkg.com/boxicons@2.1.1/css/boxicons.min.css' rel='stylesheet" />
  18.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" integrity="sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  19.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css" integrity="sha512-sMXtMNL1zRzolHYKEujM2AqCLUR9F2C4/05cdbxjjLSRvMQIciEPCQZo++nk7go3BtSuK9kfa/s+a4f4i5pLkw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  20.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  21.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
  22.     <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
  23.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>
  24.     <link rel="stylesheet" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css" />
  25.     <link rel="stylesheet" href="{{ asset('css/base.css') }}" />
  26.     {# link notif #}
  27.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
  28.     {% block stylesheets %}
  29.       {{ encore_entry_link_tags('app') }}
  30.     {% endblock %}
  31.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
  32.     {# Ajustements RTL chargés uniquement en arabe, en dernier pour surcharger sans impacter le mode LTR #}
  33.     {% if is_rtl %}
  34.       <link rel="stylesheet" href="{{ asset('css/rtl.css') }}" />
  35.     {% endif %}
  36.   </head>
  37.   <body>
  38.     <div class="header">
  39.       <nav class="navbar navbar-expand-lg fixed-top {{ app.request.locale == 'ar_TN' ? 'form_direction_rtl' : 'form_direction_ltr' }}">
  40.         <a class="navbar-brand" href="{{ path('accueil') }}"><img src="{{ asset('/images/Fichier1.png') }}" alt="" /></a>
  41.         <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
  42.         {% set id = app.request.attributes.get('id') %}
  43.         <div class="collapse navbar-collapse align-items-center" id="navbarSupportedContent">
  44.           <ul class="navbar-nav ml-auto menu-middle align-items-start" id="change_color">
  45.             <li class="nav-item menu" id="actualites">
  46.               <a class="nav-link" href="{{ path('accueil') }}#section-actualites" id="path_accueil">{% trans %}menu_base.Actualites{% endtrans %}</a>
  47.             </li>
  48.             <li class="nav-item menu change_li" id="about">
  49.               <a class="nav-link" href="{{ path('accueil') }}#section-about">CNFCPP</a>
  50.             </li>
  51.             <li class="nav-item menu change_li" id="services">
  52.               <a class="nav-link" href="{{ path('accueil') }}#section-services">{% trans %}menu_base.Services{% endtrans %}</a>
  53.             </li>
  54.             <li class="nav-item menu change_li" id="formation">
  55.               <a class="nav-link" href="{{ path('accueil') }}#section-formation">{% trans %}menu_base.Sessions_formation{% endtrans %}</a>
  56.             </li>
  57.             <li class="nav-item menu change_li" id="article">
  58.               <a class="nav-link" href="{{ path('accueil') }}#section-article">{% trans %}menu_base.Article{% endtrans %}</a>
  59.             </li>
  60.             <li class="nav-item menu change_li" id="doc">
  61.               <a class="nav-link" href="{{ path('accueil') }}#section-doc">{% trans %}menu_base.Centre_ressources{% endtrans %}</a>
  62.             </li>
  63.             <li class="nav-item menu change_li" id="galerie">
  64.               <a class="nav-link" href="{{ path('show_galerie') }}" id="path_galerie">{% trans %}menu_base.Galerie{% endtrans %}</a>
  65.             </li>
  66.             <li class="nav-item menu change_li" id="accueil_footer">
  67.               <a class="nav-link" href="{{ path('accueil') }}#footer">{% trans %}menu_base.Contact{% endtrans %}</a>
  68.             </li>
  69.           </ul>
  70.           {% if app.user and app.user.isVerified %}
  71.             {% if app.user.roles[0] == 'ROLE_PARTICULIER' or app.user.roles[0] == 'ROLE_ENTREPRISES' or app.user.roles[0] == 'ROLE_PARTENAIRES_NATIONAUX' or app.user.roles[0] == 'ROLE_PARTENAIRES_REGIONAUX' or app.user.roles[0] == 'ROLE_AUTRES' %}
  72.               <ul class="navbar-nav ml-auto btn-connx align-items-center d-flex">
  73.                 <li class="nav-item text-center dropdown">
  74.                   <a href="#" class="dropbtn display-desktop notification-ring" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  75.                     <i class="fa-solid fa-bell" id="notif-r"></i>
  76.                     {# {% if notifications_count > 0 %} #}
  77.                     <span class="notification_count"></span>
  78.                     {# {% endif %} #}
  79.                   </a>
  80.                   {{ render(url('app_notification_list_front')) }}
  81.                 </li>
  82.                 <li class="nav-item text-center">
  83.                   <a class="nav-link cart-ring" href="{{ path('show_cart') }}">
  84.                     <i class="fa fa-shopping-cart" aria-hidden="true" id="cart-shop"></i>
  85.                     <span id="notifCartSpan" class="cart-count"></span>
  86.                   </a>
  87.                 </li>
  88.               </ul>
  89.             {% endif %}
  90.             {% if app.user.roles[0] == 'ROLE_ADMIN' or app.user.roles[0] == 'ROLE_CHARGE_ASSISTANCE' or app.user.roles[0] == 'ROLE_DAE' or app.user.roles[0] == 'ROLE_UNITE_REGINALE' or app.user.roles[0] == 'ROLE_AGENT_INTERNE' %}
  91.               <ul class="navbar-nav ml-auto btn-connx align-items-center d-flex">
  92.                 <li class="nav-item text-center dropdown">
  93.                   <a href="#" class="dropbtn display-desktop notification-ring" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  94.                     <i class="fa-solid fa-bell" id="notif-r"></i>
  95.                     {# {% if notifications_count > 0 %} #}
  96.                     <span class="notification_count"></span>
  97.                     {# {% endif %} #}
  98.                   </a>
  99.                   {{ render(url('app_notification_list')) }}
  100.                 </li>
  101.               </ul>
  102.             {% endif %}
  103.             <div class="dropdown text-center d-flex justify-content-center align-items-center" id="dropdown-Dae">
  104.               <a href="#" class="align-items-center text-black text-decoration-none dropdown-toggle" id="dropdownUser1" data-toggle="dropdown" aria-expanded="false">
  105.                 <img src="{{ asset('/images/user.png') }}" alt="" />
  106.                 <span class="user-header">{{ app.user.username }}</span>
  107.               </a>
  108.               <div class="nav-item dropdown">
  109.                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="background-color: white;border: none;"><img src="{{ app.session.get('_locale') == 'ar_TN' ? asset('images/tunisia.png') : asset('images/france (1).png') }}" alt="" style="width: 30px;" /></a>
  110.                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  111.                   <a class="dropdown-item traduction" href="{{ path('app_change_locale', { '_locale': app.session.get('_locale') == 'ar_TN' ? 'fr' : 'ar_TN' }) }}"><img src="{{ app.session.get('_locale') == 'ar_TN' ? asset('images/france (1).png') : asset('images/tunisia.png') }}" alt="" style="width: 30px;" /></a>
  112.                 </div>
  113.               </div>
  114.               <ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1" style="">
  115.                 {% if not is_granted('ROLE_ENTREPRISES') and not is_granted('ROLE_PARTENAIRES_NATIONAUX') and not is_granted('ROLE_PARTENAIRES_REGIONAUX') and not is_granted('ROLE_PARTICULIER') and not is_granted('ROLE_AUTRES') %}
  116.                   <li class="dropdown-item auth">
  117.                     <a class="dropdown-item log-out-user" href="{{ path('dashboard') }}">{% trans %}menu_base.Dashboard{% endtrans %}</a>
  118.                   </li>
  119.                 {% endif %}
  120.                 {% if app.user.roles[0] != 'ROLE_SUPER_ADMIN' and app.user.roles[0] != 'ROLE_ADMIN' %}
  121.                   <li class="dropdown-item auth">
  122.                     <a class="dropdown-item custom-user" href="{{ path('app_profil') }}">{% trans %}menu_base.Modifier_profil{% endtrans %}</a>
  123.                   </li>
  124.                 {% endif %}
  125.                 {% if is_granted('ROLE_ENTREPRISES') or is_granted('ROLE_PARTENAIRES_NATIONAUX') or is_granted('ROLE_PARTENAIRES_REGIONAUX') %}
  126.                   <li class="dropdown-item auth">
  127.                     <a class="dropdown-item log-out-user" href="{{ path('app_list_demande') }}">{% trans %}menu_base.Demandes{% endtrans %}</a>
  128.                   </li>
  129.                 {% endif %}
  130.                 {% if app.user.roles[0] == 'ROLE_PARTICULIER' or app.user.roles[0] == 'ROLE_AUTRES' %}
  131.                   <li class="dropdown-item auth">
  132.                     <a class="dropdown-item log-out-user" href="{{ path('app_listInscri') }}">{% trans %}menu_base.Mes_inscriptions{% endtrans %}</a>
  133.                   </li>
  134.                 {% endif %}
  135.                 {% if app.user.roles[0] == 'ROLE_PARTICULIER' or app.user.roles[0] == 'ROLE_ENTREPRISES' or app.user.roles[0] == 'ROLE_PARTENAIRES_NATIONAUX' or app.user.roles[0] == 'ROLE_PARTENAIRES_REGIONAUX' or app.user.roles[0] == 'ROLE_AUTRES' %}
  136.                   <li class="dropdown-item auth">
  137.                     <a class="dropdown-item log-out-user" href="{{ path('command_history') }}">{% trans %}menu_base.Commandes{% endtrans %}</a>
  138.                   </li>
  139.                   <li class="dropdown-item auth">
  140.                     <a class="dropdown-item log-out-user" href="{{ path('app_list') }}">{% trans %}menu_base.Documents{% endtrans %}</a>
  141.                   </li>
  142.                   <li class="dropdown-item auth">
  143.                     <a class="dropdown-item log-out-user" href="{{ path('app_list_sujet_propose') }}">{% trans %}menu_base.Sujets_proposés{% endtrans %}</a>
  144.                   </li>
  145.                 {% endif %}
  146.                 <li class="dropdown-item auth">
  147.                   <a class="dropdown-item log-out-user" href="{{ path('logout') }}">{% trans %}menu_base.Déconnexion{% endtrans %}</a>
  148.                 </li>
  149.               </ul>
  150.             </div>
  151.           {% else %}
  152.             <ul class="navbar-nav ml-auto btn-connx align-items-center">
  153.               <li class="nav-item text-center">
  154.                 <a class="nav-link cart-ring" href="{{ path('show_cart') }}">
  155.                   <i class="fa fa-shopping-cart" aria-hidden="true" id="cart-shop"></i>
  156.                   <span id="notifCartSpan" class="cart-count"></span>
  157.                 </a>
  158.               </li>
  159.               <li class="nav-item text-center">
  160.                 <a class="nav-link" href="{{ path('login') }}">{% trans %}menu_base.Connexion{% endtrans %}</a>
  161.               </li>
  162.               <li class="nav-item text-center">
  163.                 <a class="nav-link" href="{{ path('app_register') }}">{% trans %}menu_base.Créer_compte{% endtrans %}</a>
  164.               </li>
  165.               <li class="nav-item dropdown">
  166.                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="background-color: white;border: none;"><img src="{{ app.session.get('_locale') == 'ar_TN' ? asset('images/tunisia.png') : asset('images/france (1).png') }}" alt="" style="width: 30px;" /></a>
  167.                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  168.                   <a class="dropdown-item traduction" href="{{ path('app_change_locale', { '_locale': app.session.get('_locale') == 'ar_TN' ? 'fr' : 'ar_TN' }) }}"><img src="{{ app.session.get('_locale') == 'ar_TN' ? asset('images/france (1).png') : asset('images/tunisia.png') }}" alt="" style="width: 30px;" /></a>
  169.                 </div>
  170.               </li>
  171.             </ul>
  172.           {% endif %}
  173.         </div>
  174.       </nav>
  175.     </div>
  176.     {% block body %}
  177.     {% endblock %}
  178.     {% block modals %}
  179.     {% endblock %}
  180.     <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  181.     <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  182.     {# <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> #}
  183.     <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js" integrity="sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  184.     <script src="{{ asset('js/script.js') }}"></script>
  185.     <script src="{{ asset('js/script-faq.js') }}"></script>
  186.     <script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
  187.     <!-- Include jQuery -->
  188.     <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  189.     {% block javascripts %}
  190.       <script>
  191.         $(document).ready(function () {
  192.           $.ajax({
  193.             url: "{{ path('count_command_article_by_user') }}",
  194.             type: 'GET',
  195.             dataType: 'json',
  196.             success: function (response) {
  197.               if (response.count > 0) {
  198.                 $('#notifCartSpan').html(`<strong id="notifCart" class="cart-badge">${response.count}</strong>`)
  199.               } else {
  200.                 $('#notifCartSpan').html('')
  201.               }
  202.             }
  203.           })
  204.         
  205.           $.ajax({
  206.             url: "{{ path('count_notification_by_user') }}",
  207.             type: 'GET',
  208.             dataType: 'json',
  209.             success: function (response) {
  210.               if (response.count > 0) {
  211.                 $('.notification_count').html(`<strong class="notification-dot" >${response.count}</strong>`)
  212.               } else {
  213.                 $('.notification_count').html('')
  214.               }
  215.             }
  216.           })
  217.         })
  218.         
  219.         document.addEventListener('DOMContentLoaded', function () {
  220.           var menuLinks = Array.from(document.querySelectorAll('#change_color .nav-item.menu > a.nav-link'))
  221.           var menuItems = Array.from(document.querySelectorAll('#change_color .nav-item.menu'))
  222.           var isAccueilPage = window.location.pathname === "{{ path('accueil') }}"
  223.           function clearCurrent() {
  224.             menuItems.forEach(function (item) {
  225.               item.classList.remove('current')
  226.             })
  227.           }
  228.           function setCurrentByItemId(itemId) {
  229.             clearCurrent()
  230.             var item = document.getElementById(itemId)
  231.             if (item) {
  232.               item.classList.add('current')
  233.             }
  234.           }
  235.           function setCurrentByHash(hash) {
  236.             if (!hash) return
  237.             var matchLink = menuLinks.find(function (link) {
  238.               return link.getAttribute('href') && link.getAttribute('href').indexOf(hash) !== -1
  239.             })
  240.             if (matchLink && matchLink.closest('.nav-item')) {
  241.               setCurrentByItemId(matchLink.closest('.nav-item').id)
  242.             }
  243.           }
  244.           // Clic menu : met à jour immédiatement l'onglet actif
  245.           menuLinks.forEach(function (link) {
  246.             link.addEventListener('click', function () {
  247.               var li = link.closest('.nav-item')
  248.               if (li) {
  249.                 setCurrentByItemId(li.id)
  250.               }
  251.             })
  252.           })
  253.           // Sur pages hors accueil, active simplement l'entrée correspondant à l'URL
  254.           if (!isAccueilPage) {
  255.             var currentPath = window.location.pathname
  256.             var pathLink = menuLinks.find(function (link) {
  257.               try {
  258.                 return new URL(link.href, window.location.origin).pathname === currentPath
  259.               } catch (e) {
  260.                 return false
  261.               }
  262.             })
  263.             if (pathLink && pathLink.closest('.nav-item')) {
  264.               setCurrentByItemId(pathLink.closest('.nav-item').id)
  265.             } else if (window.location.hash) {
  266.               setCurrentByHash(window.location.hash)
  267.             }
  268.             return
  269.           }
  270.           // Sur accueil : scrollspy sur sections
  271.           var sectionMap = [
  272.             { sectionId: 'section-actualites', navItemId: 'actualites' },
  273.             { sectionId: 'section-about', navItemId: 'about' },
  274.             { sectionId: 'section-services', navItemId: 'services' },
  275.             { sectionId: 'section-formation', navItemId: 'formation' },
  276.             { sectionId: 'section-article', navItemId: 'article' },
  277.             { sectionId: 'section-doc', navItemId: 'doc' },
  278.             { sectionId: 'footer', navItemId: 'accueil_footer' }
  279.           ].filter(function (item) { return document.getElementById(item.sectionId) })
  280.           function updateCurrentByScroll() {
  281.             var navHeight = document.querySelector('.navbar.fixed-top') ? document.querySelector('.navbar.fixed-top').offsetHeight : 80
  282.             var checkpoint = window.scrollY + navHeight + 40
  283.             var active = sectionMap[0]
  284.             sectionMap.forEach(function (item) {
  285.               var section = document.getElementById(item.sectionId)
  286.               if (section && section.offsetTop <= checkpoint) {
  287.                 active = item
  288.               }
  289.             })
  290.             if (active) {
  291.               setCurrentByItemId(active.navItemId)
  292.               var targetHash = '#' + active.sectionId
  293.               if (window.location.hash !== targetHash) {
  294.                 history.replaceState(null, '', targetHash)
  295.               }
  296.             }
  297.           }
  298.           if (window.location.hash) {
  299.             setCurrentByHash(window.location.hash)
  300.           } else {
  301.             updateCurrentByScroll()
  302.           }
  303.           window.addEventListener('scroll', updateCurrentByScroll, { passive: true })
  304.           window.addEventListener('hashchange', function () {
  305.             setCurrentByHash(window.location.hash)
  306.           })
  307.         })
  308.       </script>
  309.     {% endblock %}
  310.   </body>
  311. </html>