templates/Default/menu.html.twig line 1

Open in your IDE?
  1. {% extends 'Default/parameters.html.twig' %}
  2. {% import "Default/macros.html.twig" as macros %}
  3. {% block html %}
  4. {% apply spaceless %}
  5. {% set menus = [] %}
  6. {# {% set menus = menus|merge({'home':{label:"Accueil", href:path("home"), id:'home'}}) %} #}
  7. {% set submenus = [] %}
  8. {% set submenus = submenus|merge([{label:"Présentation", href:path("page",{slug:'a-propos'})}]) %}
  9. {% set submenus = submenus|merge([{label:"Mission et attributions", href:path("page",{slug:'mission-attributions'})}]) %}
  10. {% set submenus = submenus|merge([{label:"Organigramme", href:path("page",{slug:'organigramme'})}]) %}
  11. {% for o in membersCats %}
  12. {% set submenus = submenus|merge([{label:o.label, href: path("members",{slug:o.slug}) }]) %}
  13. {% endfor %}
  14. {% set menus = menus|merge({'about':{label:"L'école", submenus:submenus, id:'about'}}) %}
  15. {% set submenus = [] %}
  16. {% for o in servicesCats %}
  17. {% set submenus = submenus|merge([{label:o.label, href: path("formations-cat",{slug:o.slug}) }]) %}
  18. {% endfor %}
  19. {# {% set submenus = submenus|merge([{label:"Formation initiale", href:path("formations")}]) %}
  20. {% set submenus = submenus|merge([{label:"Formation continue", href:path("formations")}]) %} #}
  21. {% set menus = menus|merge({'formations':{label:"Formations", href:path("formations"), submenus:submenus, id:'formations'}}) %}
  22. {% set submenus = [] %}
  23. {% for o in articlesCats %}
  24. {% set submenus = submenus|merge([{label:o.name, href: path("articles-cat",{cat:o.slug}) }]) %}
  25. {% endfor %}
  26. {% set menus = menus|merge({'articles':{label:"Actualités", href:path("articles"), submenus:submenus, id:'articles'}}) %}
  27. {% set menus = menus|merge({'events':{label:"Colloques", href:path("events"), id:'events'}}) %}
  28. {% set menus = menus|merge({'professions':{label:"Professions", href:path("professions"), id:'professions'}}) %}
  29. {% set menus = menus|merge({'resources':{label:"Ressources", href:path("resources"), id:'resources'}}) %}
  30. {% set menus = menus|merge({'contacts':{label:"Contacts", href:path('contacts'), id:'contacts'}}) %}
  31. {% block content %}
  32. {% if isMobile() %}
  33. <div class=''>
  34.     <ul class='list h4 upper flex col lspacing vt-15-in gpadding white'>
  35.         {% for o in menus %}
  36.         <li class='vt-3-in'>
  37.             {% if o.href is defined and o.href and o.submenus is not defined %}
  38.             <a href='{{o.href}}' class='vt-8-in nowrap flex col middle relative pointer medium'>{{o.label}}</a>
  39.             {% else %}
  40.             <span class='vt-8-in nowrap flex row space middle relative pointer medium os-click' data-target='next'>
  41.                 <span>{{o.label}}</span>
  42.                 <i class='fa fa-chevron-down'></i>
  43.             </span>
  44.             {% endif %}
  45.             {% if o.submenus is defined %}
  46.             <ul class='left-20-in top-7-in border border-gray border-notop border-noright border-nobottom'>
  47.                 {% if o.href is defined %}
  48.                 <li>
  49.                     <a href='{{o.href}}' class='flex col middle relative pointer vt-3-in'>Vue d'ensemble</a>
  50.                 </li>
  51.                 {% endif %}
  52.                 {% for k in o.submenus %}
  53.                 <li>
  54.                     <a href='{{k.href}}' class='flex col middle relative pointer vt-3-in'>{{k.label}}</a>
  55.                 </li>
  56.                 {% endfor %}
  57.             </ul>
  58.             {% endif %}
  59.         </li>
  60.         {% endfor %}
  61.     </ul>
  62. </div>
  63. {% else %}
  64. <div class='fill top'>
  65.     <ul class='list flex row center p-alt black fill text-center'>
  66.         {% for o in menus %}
  67.         <li class='relative h100 menu transition hz-15 {{activeMenu == o.id ? "active"}}'>
  68.             {% if o.href is defined and o.href %}
  69.             <a href='{{o.href}}' class='nowrap transition relative pointer iflex row middle h100'>
  70.                 <span class='vt-5-in {{o.isSpecial is defined ? 'warning extrabold'}}'>{{o.label}}</span>
  71.             </a>
  72.             {% else %}
  73.             <span class='os-click transition relative iflex row middle h100' data-target='next'>
  74.                 <span class='vt-5-in'>{{o.label}}</span>
  75.             </span>
  76.             {% endif %}
  77.             {% if o.submenus is defined %}
  78.             <ul class='absolute shadow transition-1s p-alt text-left black vt-10-in hz-20-in hoverflow ytop-100'>
  79.                 <i class="absolute fill top left bg-warning"></i>
  80.                 {% for k in o.submenus %}
  81.                 <li class='relative'>
  82.                     <a href='{{k.href}}' class='iflex col middle relative pointer vt-5-in transition'>{{k.label}}</a>
  83.                 </li>
  84.                 {% endfor %}
  85.             </ul>
  86.             {% endif %}
  87.         </li>
  88.         {% endfor %}
  89.     </ul>
  90. </div>
  91. {% endif %}
  92. {% endblock %}
  93. {% endapply %}
  94. {% endblock %}