templates/shared/topbar.html.twig line 1

Open in your IDE?
  1. {% set anonymousTopbar = topbarAnonymous|default(false) or not app.user|default(null) %}
  2. {% set sidebarTopbar = adminSidebar|default(false) %}
  3. <nav class="navbar navbar-expand-lg navbar-dark conreg-topbar{{ anonymousTopbar ? ' conreg-topbar--anonymous' : '' }}{{ sidebarTopbar ? ' conreg-topbar--admin' : '' }}" aria-label="{{ 'navigation.main-menu'|trans({}, 'messages') }}">
  4.     <a class="navbar-brand conreg-topbar__brand" href="/">{% include 'shared/wordmark.html.twig' %}</a>
  5.     {% if not anonymousTopbar %}
  6.         {% if sidebarTopbar %}
  7.             {# Keep EasyAdmin's sidebar handler rather than replacing it with Bootstrap collapse. #}
  8.             <button id="navigation-toggler" class="conreg-topbar__toggle" type="button" aria-label="{{ 'navigation.toggle-menu'|trans({}, 'messages') }}">
  9.                 <i class="fa fa-bars" aria-hidden="true"></i>
  10.             </button>
  11.         {% else %}
  12.             <button class="navbar-toggler conreg-topbar__toggle" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ 'navigation.toggle-menu'|trans({}, 'messages') }}">
  13.                 <span class="navbar-toggler-icon"></span>
  14.             </button>
  15.         {% endif %}
  16.         <div class="conreg-topbar__navigation{{ sidebarTopbar ? ' d-none d-lg-flex navbar-collapse' : ' collapse navbar-collapse' }}"{% if not sidebarTopbar %} id="navbarSupportedContent"{% endif %}>
  17.             <ul class="navbar-nav conreg-topbar__links">
  18.                 {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_CUSTOMER') %}
  19.                     {% set topbarEntity = app.request.query.get('entity', '') %}
  20.                     <li class="nav-item">
  21.                         <a href="{{ easyadmin_path('UserSetting', 'edit') }}" class="nav-link{{ topbarEntity == 'UserSetting' ? ' active' : '' }}"{% if topbarEntity == 'UserSetting' %} aria-current="page"{% endif %}>
  22.                             <i class="fa fa-cog" aria-hidden="true"></i> {{ 'navigation.device-settings'|trans({}, 'messages') }}
  23.                         </a>
  24.                     </li>
  25.                     <li class="nav-item">
  26.                         <a class="nav-link{{ topbarEntity == 'User' ? ' active' : '' }}" href="{{ path('easyadmin', {'entity':'User', 'action':'list'}) }}"{% if topbarEntity == 'User' %} aria-current="page"{% endif %}>
  27.                             <i class="fa fa-user" aria-hidden="true"></i> {{ 'manage users'|trans({}, 'messages')|capitalize }}
  28.                         </a>
  29.                     </li>
  30.                 {% endif %}
  31.                 {% if topbarReport|default(false) %}{% include 'panel/report/button.html.twig' %}{% endif %}
  32.             </ul>
  33.         </div>
  34.         {% include 'panel/menu/user_menu.html.twig' with {'refreshTopbar': true} %}
  35.     {% endif %}
  36. </nav>