templates/nav.html.twig line 1

Open in your IDE?
  1. {% set currentPath = app.request.uri %}
  2. <nav id="main" {{ stimulus_controller('menu') }} data-menu-open-value="true" data-menu-active-class="menu-open">
  3.     <div class="menu-title" {{ stimulus_action('menu', 'toggleMenu', 'click') }}>
  4.         <span>{% block menuTitle 'Main Menu' %}</span>
  5.     </div>
  6.     <div class="menu-body" {{ stimulus_target('menu', 'container') }}>
  7.         <div class="menu-icons">
  8.             <a href="/" title="Home">
  9.                 <span class="fa fa-home"></span>
  10.             </a>
  11.             <a href="https://commcent.swc-empire.com" title="COMMCENT">
  12.                 <span class="fa fa-comments"></span>
  13.             </a>
  14.             <a href="https://swcombine.com" title="Star Wars Combine" style="padding-top: 2px;">
  15.                 <svg width="18px" height="18px" viewBox="0 0 180 180">
  16.                     <use xlink:href="#icon-combine"></use>
  17.                 </svg>
  18.             </a>
  19.         </div>
  20.         <div class="menu" {{ stimulus_controller('menu') }} data-menu-open-value="{{ ('admin' not in currentPath) and ('instructor' not in currentPath) ? 'true' : 'false' }}" data-menu-active-class="menu-active">
  21.             <h2 {{ stimulus_action('menu', 'toggleSubMenu', 'click') }}>Academy</h2>
  22.             <ul {{ stimulus_target('menu', 'subMenu') }}>
  23.                 <li>
  24.                     <a href="/" class="menu-active-link">
  25.                         <span><i class='fa fa-caret-right'></i></span>
  26.                         Home
  27.                     </a>
  28.                 </li>
  29.                 {% if not app.user %}
  30.                 <li>
  31.                     <a href="{{ url('auth_login') }}" class="menu-active-link">
  32.                         <span><i class='fa fa-caret-right'></i></span>
  33.                         Login
  34.                     </a>
  35.                 </li>
  36.                 {% endif %}
  37.                 {% if app.user %}
  38.                     <li>
  39.                         <a href="{{ url('profile') }}" class="menu-active-link">
  40.                             <span><i class='fa fa-caret-right'></i></span>
  41.                             Profile
  42.                         </a>
  43.                     </li>
  44.                     <li>
  45.                         <a href="{{ url('course_list') }}" class="menu-active-link">
  46.                             <span><i class='fa fa-caret-right'></i></span>
  47.                             Courses
  48.                         </a>
  49.                     </li>
  50.                     <li>
  51.                         <a href="{{ url('auth_logout') }}" class="menu-active-link">
  52.                             <span><i class='fa fa-caret-right'></i></span>
  53.                             Logout
  54.                         </a>
  55.                     </li>
  56.                 {% endif %}
  57.             </ul>
  58.         </div>
  59.         {% if is_granted('INSTRUCTOR') %}
  60.             <div class="menu" {{ stimulus_controller('menu') }} data-menu-open-value="{{ 'instructor' in currentPath ? 'true' : 'false' }}" data-menu-active-class="menu-active">
  61.                 <h2 {{ stimulus_action('menu', 'toggleSubMenu', 'click') }}>Instructor</h2>
  62.                 <ul {{ stimulus_target('menu', 'subMenu') }}>
  63.                     <li>
  64.                         <a href="{{ url('instructor_students_list') }}">
  65.                             <span><i class='fa fa-caret-right'></i></span>
  66.                             Students
  67.                         </a>
  68.                     </li>
  69.                     <li>
  70.                         <a href="{{ url('instructor_students_register') }}">
  71.                             <span><i class='fa fa-caret-right'></i></span>
  72.                             Register Student
  73.                         </a>
  74.                     </li>
  75.                 </ul>
  76.             </div>
  77.         {% endif %}
  78.         {% if is_granted('ADMIN') %}
  79.         <div class="menu" {{ stimulus_controller('menu') }} data-menu-open-value="{{ 'admin' in currentPath ? 'true' : 'false' }}" data-menu-active-class="menu-active">
  80.             <h2 {{ stimulus_action('menu', 'toggleSubMenu', 'click') }}>Admin</h2>
  81.             <ul {{ stimulus_target('menu', 'subMenu') }}>
  82.                 <li>
  83.                     <a href="{{ url('admin_courses_list') }}">
  84.                         <span><i class='fa fa-caret-right'></i></span>
  85.                         Courses
  86.                     </a>
  87.                 </li>
  88.                 <li>
  89.                     <a href="{{ url('admin_users_list') }}">
  90.                         <span><i class='fa fa-caret-right'></i></span>
  91.                         Users
  92.                     </a>
  93.                 </li>
  94.                 <li>
  95.                     <a href="{{ url('admin_pages_list') }}">
  96.                         <span><i class='fa fa-caret-right'></i></span>
  97.                         Pages
  98.                     </a>
  99.                 </li>
  100.                 <li>
  101.                     <a href="{{ url('admin_positions_list') }}">
  102.                         <span><i class='fa fa-caret-right'></i></span>
  103.                         Positions
  104.                     </a>
  105.                 </li>
  106.             </ul>
  107.         </div>
  108.         {% endif %}
  109.     </div>
  110.     <svg aria-hidden="true" style="position:absolute;width:0;height:0;overflow:hidden" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  111.         <defs>
  112.             <symbol id="icon-combine" viewBox="0 0 32 32">
  113.                 <title>combine</title>
  114.                 <path fill="#ddd" stroke="#ddd" stroke-width="1.7778" stroke-miterlimit="4" stroke-linecap="butt" stroke-linejoin="miter" style="stroke:var(--color2,#ddd)" style="fill: var(--color2, #ddd)" d="M0 15.822c0-7.004 5.618-13.689 13.156-13.689 6.009 0 10.844 4.124 10.844 10.311 0 3.698-2.88 7.822-7.289 7.822-3.911 0-6.044-2.489-6.044-5.511-0.64 0-1.067 1.067-1.067 2.133 0 2.951 3.52 6.044 7.644 6.044 5.404 0 11.022-4.942 11.022-12.267 0-4.551-2.204-8.356-4.089-10.667 2.311 1.956 5.689 5.831 5.689 11.911 0 7.004-5.618 13.689-13.156 13.689-6.009 0-10.844-4.124-10.844-10.311 0-3.698 2.88-7.822 7.289-7.822 3.911 0 6.044 2.489 6.044 5.511 0.64 0 1.067-1.067 1.067-2.133 0-2.951-3.52-6.044-7.644-6.044-5.404 0-11.022 4.942-11.022 12.267 0 4.551 2.204 8.356 4.089 10.667-2.311-1.956-5.689-5.831-5.689-11.911z"></path>
  115.             </symbol>
  116.         </defs>
  117.     </svg>
  118. </nav>