templates/includes/sidebar.html.twig line 1

Open in your IDE?
  1. {%set getCurrentUrl = app.request.pathinfo|split('/')[1]%}
  2. {%set secondCurrentUrl = app.request.pathinfo|split('/')[2]%}
  3. <nav id="sidebarMenu" class="sidebar d-lg-block bg-gray-800 text-white collapse">
  4.   <div class="sidebar-inner px-4 pt-3">
  5.     
  6.     <ul class="nav flex-column pt-3 pt-md-0">
  7.       <li class="mb-5">
  8.         <a href="#" class="nav-link d-flex align-items-center">
  9.           <span class="sidebar-icon">
  10.             <img src="{{asset('assets/images/avatar-1.png')}}" height="20" width="20" alt="Volt Logo">
  11.           </span>
  12.           <span class="mt-1 ms-1 sidebar-text">FCZ - RH</span>
  13.         </a>
  14.       </li>
  15.       
  16.       
  17.       {% for module in app.session.get('modules') %}
  18.       <li class="nav-item {% if getCurrentUrl == module.module.prefix %} active {% endif %}">
  19.         <span
  20.           class="nav-link  collapsed  d-flex justify-content-between align-items-center"
  21.           data-bs-toggle="collapse" data-bs-target="#{{module.module.prefix}}" {% if getCurrentUrl == module.module.prefix %} aria-expanded="true" {% endif %}>
  22.           <span>
  23.             <span class="sidebar-icon">
  24.               <i class="icon icon-xs me-2 {{module.module.icon}}"></i>
  25.               {# <svg class="icon icon-xs me-2" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M2 5a2 2 0 012-2h8a2 2 0 012 2v10a2 2 0 002 2H4a2 2 0 01-2-2V5zm3 1h6v4H5V6zm6 6H5v2h6v-2z" clip-rule="evenodd"></path><path d="M15 7h1a2 2 0 012 2v5.5a1.5 1.5 0 01-3 0V7z"></path></svg> #}
  26.             </span> 
  27.             <span class="sidebar-text">{{module.module.designation}}</span>
  28.           </span>
  29.           <span class="link-arrow">
  30.             <svg class="icon icon-sm" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
  31.           </span>
  32.         </span>
  33.         <div class="multi-level collapse {% if getCurrentUrl == module.module.prefix %} show {% endif %} " role="list"
  34.           id="{{module.module.prefix}}" aria-expanded="false">
  35.           <ul class="flex-column nav">
  36.             {% for sousModule in module.sousModule %}
  37.             <li class="nav-item  {% if getCurrentUrl == module.module.prefix and secondCurrentUrl == sousModule.prefix %} activeSecondUrl {% endif %}">
  38.               <a class="nav-link" href="{{path(sousModule.link)}}">
  39.                 <span class="sidebar-text">{{sousModule.designation}}</span>
  40.               </a>
  41.             </li>
  42.             {% endfor %}
  43.           </ul>
  44.         </div>
  45.       </li>
  46.       {% endfor %}
  47.      
  48.       
  49.     </ul>
  50.   </div>
  51. </nav>