templates/menu.html.twig line 1

Open in your IDE?
  1. {% import 'macros/macro_elements.html.twig' as ME %}
  2. {% if app.user is not null %}
  3.     <div class="collapse show" id="menu-container">
  4.         <div class="menu d-flex flex-column justify-content-between">
  5.             <ul class="navbar-nav">
  6. {#                {{ ME.showElementsByRole(['ROLE_BANNER'], [#}
  7.                 {{ ME.showElementsByRole(['ROLE_IMAGENES_VISUALIZADOR'], [
  8.                     ME.getLiMenu('imagenes', 'far fa-image', 'Imágenes de portada', 'index_imagen')
  9.                 ]) }}
  10.                 {{ ME.showElementsByRole(['ROLE_HOME'], [
  11.                     ME.getLiMenuWithSubMenus('home', 'fas fa-home', 'Home', [
  12.                         {'id': 'banner', 'name': 'Banner', 'route': 'index_banner', 'role': 'ROLE_BANNER_VISUALIZADOR' },
  13.                         {'id': 'secciones', 'name': 'Secciones', 'route': 'index_seccion', 'role': 'ROLE_SECCION_VISUALIZADOR' },
  14.                         {'id': 'etiquetas', 'name': 'Más buscados', 'route': 'index_etiqueta', 'role': 'ROLE_ETIQUETA_VISUALIZADOR' },
  15.                         {'id': 'acciones', 'name': 'Qué necesitas', 'route': 'index_accion', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  16.                         {'id': 'tipodestacados', 'name': 'Tipo Destacados', 'route': 'index_tipo_destacado', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  17.                         {'id': 'destacados', 'name': 'Destacados', 'route': 'index_destacados', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  18.                         {'id': 'momentos', 'name': 'Momentos de vida', 'route': 'index_momentos_de_vida', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  19.                         {'id': 'tituloTramitesServicios', 'name': 'Headers de secciones', 'route': 'index_componente_titulo', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  20.                         {'id': 'cardTramitesServicios', 'name': 'T&S-Tarjetas', 'route': 'index_categoria', 'role': 'ROLE_TRAMITES_SERVICIOS_VISUALIZADOR' },
  21.                         {'id': 'baProductivaAreas', 'name': 'BA-Productiva Áreas', 'route': 'index_ba_productiva_area', 'role': 'ROLE_BA_PRODUCTIVA_VISUALIZADOR' },
  22.                         {'id': 'baProductivaRubros', 'name': 'BA-Productiva Rubros', 'route': 'index_ba_productiva_rubro', 'role': 'ROLE_BA_PRODUCTIVA_VISUALIZADOR' },
  23.                     ])
  24.                 ]) }}
  25.                 {{ ME.showElementsByRole(['ROLE_TRAMITES_SERVICIOS_VISUALIZADOR'], [
  26.                     ME.getLiMenu('tramites', 'far fa-file-alt', 'Trámites', 'index_tramite')
  27.                 ]) }}
  28.                 {{ ME.showElementsByRole(['ROLE_CONTACTO'], [
  29.                     ME.getLiMenuWithSubMenus('contacto', 'far fa-paper-plane', 'Contacto', [
  30.                         {'id': 'telefonos', 'name': 'Teléfonos', 'route': 'index_telefono', 'role': 'ROLE_TELEFONOS_VISUALIZADOR'},
  31.                         {'id': 'redesSociales', 'name': 'Redes sociales', 'route': 'index_red_social', 'role': 'ROLE_REDES_SOCIALES_VISUALIZADOR'}
  32.                     ])
  33.                 ]) }}
  34.                 {{ ME.showElementsByRole(['ROLE_INFORMACION'], [
  35.                     ME.getLiMenuWithSubMenus('informacion', 'fas fa-book', 'Información', [
  36.                         {'id': 'areasGobierno', 'name': 'Áreas de gobierno', 'route': 'index_area_gobierno', 'role': 'ROLE_AREAS_GOBIERNO_VISUALIZADOR'},
  37.                         {'id': 'terminosCondiciones', 'name': 'Términos y condiciones', 'route': 'index_terminos_condiciones', 'role': 'ROLE_TERMINOS_CONDICIONES_VISUALIZADOR'},
  38.                         {'id': 'organigrama', 'name': 'Organigrama', 'route': 'index_organigrama', 'role': 'ROLE_ORGANIGRAMA_VISUALIZADOR'},
  39.                         {'id': 'reparticion', 'name': 'Repartición', 'route': 'index_reparticion', 'role': 'ROLE_REPARTICION_VISUALIZADOR'}
  40.                     ])
  41.                 ]) }}
  42.                 {{ ME.showElementsByRole(['ROLE_ADMIN'], [
  43.                     ME.getLiMenuWithSubMenus('accesos', 'fas fa-users-cog', 'Accesos', [
  44.                         {'id': 'roles', 'name': 'Roles', 'route': 'index_role'},
  45.                         {'id': 'perfiles', 'name': 'Perfiles', 'route': 'index_perfil'},
  46.                         {'id': 'usuarios', 'name': 'Usuarios', 'route': 'index_usuario'},
  47.                         {'id': 'parameters', 'name': 'Parámetros', 'route': 'index_parameters'}
  48.                     ])
  49.                 ]) }}
  50.             </ul>
  51.             <div class="nav-item logout">
  52.                 <label class="m-0">{{ app.user.nombre }} {{ app.user.apellido }}</label>
  53.                 <button class="btn btn-default">
  54.                     <a class="font-weight-bold text-decoration-none text-danger " href="{{ path('logout') }}" title="Cerrar sesión">
  55.                         <i class="fa fa-sign-out-alt mr-2"></i>Salir
  56.                     </a>
  57.                 </button>
  58.             </div>
  59.         </div>
  60.     </div>
  61. {% endif %}
  62. <script>
  63.     $('a.nav-link').click(function (e) {
  64.         e.stopPropagation();
  65.     });
  66. </script>