templates/website/includes/menu.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, imgUpload %}
  2. {% from "website/controls/notification-icon.html.twig" import notificon %}
  3. <div class="topo" {% if productPage is defined %} data-page-height-top="{{ productPage.showShortageControlTime ? '1':'0' }}" {% endif %}>
  4.     <button class="btn-menu-mobile js--open-menu-mobile" data-menu-mobile-open="site">
  5.         <i class="fas fa-bars"></i>
  6.     </button>
  7.     {# LOGO #}
  8.     <div class="logo">
  9.         <a href="{{ path('home') }}">{{ imgUpload(getConfig('logo'), enum('AbstractEnum::PATH_OTHERS'), '', client.brand) }}</a>
  10.     </div>
  11.     {# MENU #}
  12.     <nav class="menu-links">
  13.         {% for menuItem in menu %}
  14.             {% if menuItem.show %}
  15.                 {# DROPDOWN #}
  16.                 {% if menuItem.dropdown|default(false) %}
  17.                     <div class="dropdown custom-client-{{ menuItem.class }}">
  18.                         <a><i class="fas fa-chevron-down seta"></i> {{ menuItem.text }}</a>
  19.                         <ul class="dropdown-list">
  20.                             {% for i, page in pages %}
  21.                                 {% if page.showType == 1 %}
  22.                                     {% if page.useExternalLink == 1 %}
  23.                                         <li><a href="{{ page.externalLink }}" target="_blank" title="{{ page.title }}">
  24.                                             <span>{{ page.title }}</span></a>
  25.                                         </li>
  26.                                     {% else %}
  27.                                         <li><a href="{{ path('pageDetail', { slug:page.slug }) }}" title="{{ page.title }}">
  28.                                             <span>{{ page.title }}</span></a>
  29.                                         </li>
  30.                                     {% endif %}
  31.                                 {% endif %}
  32.                             {% endfor %}
  33.                         </ul>
  34.                     </div>
  35.                 {# URL #}
  36.                 {% else %}
  37.                     <a href="{{ menuItem.link }}" class="custom-client-{{ menuItem.class }}">{{ menuItem.text }}</a>
  38.                 {% endif %}
  39.             {% endif %}
  40.         {% endfor %}
  41.         {# SEARCH #}
  42.         {% if isDarkTheme and (not isRestricted or user) %}
  43.             <a class="js--search-open">BUSCA&ensp;<i class="ico-busca">{{ ico('search') }}</i></a>
  44.             {#
  45.             <a class="js--search-open">BUSCA</a>
  46.             #}
  47.         {% endif %}
  48.     </nav>
  49.     {# LOGIN #}
  50.     {% if user is empty %}
  51.         <nav class="login">
  52.             <a href="{{ path('login') }}" class="logar">{{ getLanguage('sign_in', 'head') }}</a>
  53.             {% if not isRestricted %}
  54.                 <a href="{{ path('register') }}" class="btn-login">{{ getLanguage('create_a_user', 'head') }}</a>
  55.             {% endif %}
  56.         </nav>
  57.     {% endif %}
  58.     {% if hasProducts and not isRestricted %}
  59.         {# MOBILE BUSCA #}
  60.         <button class="btn-busca-mobile js--open-busca-mobile">
  61.             <i class="fas fa-search"></i>
  62.         </button>
  63.         {# CART #}
  64.         <div class="contem-cart">
  65.             <a href="{{ path('cart') }}">
  66.                 {{ notificon('cart', getUserCartNumber()) }}
  67.             </a>
  68.         </div>
  69.     {% endif %}
  70.     {# USER #}
  71.     {% if user %}
  72.         {# NOTIFICATIONS #}
  73.         {% include 'website/includes/submenu-notifications.html.twig' %}
  74.         {# USER ACTIONS #}
  75.         <div class="contem-user">
  76.             <div class="btn-menu js--context-menu" data-context-menu=".user-menu">
  77.                 <i class="fas fa-chevron-down seta"></i>
  78.                 <div class="avatar">
  79.                     {{ ico('user') }}
  80.                     {{ imgUpload(user.photo, enum('AbstractEnum::PATH_PROFILES'), 'user-profile') }}
  81.                 </div>
  82.             </div>
  83.             <div class="user-menu context-menu">
  84.                 <nav>
  85.                     {# ACESSO COMO ADMIN #}
  86.                     {% if canAccessAdm %}
  87.                         <a href="{{ path('adminEad') }}">
  88.                             <i class="fas fa-cogs"></i>
  89.                             <span>{{ getLanguage('admin', 'menu') }}</span>
  90.                         </a>
  91.                     {% endif %}
  92.                     {# ADMIN LOGOUT #}
  93.                     {% if session is defined and session and session.userOrigin %}
  94.                         <a href="{{ path('userLogoff') }}">
  95.                             <i class="fas fa-cogs"></i>
  96.                             <span>{{ getLanguage('back_as_admin', 'menu') }}</span>
  97.                         </a>
  98.                     {% endif %}
  99.                     <a href="{{ path('enrollentList') }}" class="custom-client-enrollments">
  100.                         <i class="fas fa-file-alt"></i>
  101.                         <span>{{ getLanguage('enrollments', 'menu') }}</span>
  102.                     </a>
  103.                     <a href="{{ path('transactionList') }}" class="custom-client-purchases">
  104.                         <i class="fas fa-shopping-bag"></i>
  105.                         <span>{{ getLanguage('purchases', 'menu') }}</span>
  106.                     </a>
  107.                     {# SUBSCRIPTIONS #}
  108.                     {% if isModuleActive("product_subscription_module") %}
  109.                         <a href="{{ path('userSubscriptionList') }}" class="custom-client-subscriptions">
  110.                             <i class="far fa-credit-card"></i>
  111.                             <span>{{ getLanguage('subscriptions', 'menu') }}</span>
  112.                         </a>
  113.                     {% endif %}
  114.                     <a href="{{ path('message') }}" class="custom-client-messages">
  115.                         <i class="fas fa-envelope"></i>
  116.                         <span>{{ getLanguage('messages', 'menu') }}</span>
  117.                     </a>
  118.                     <a href="{{ path('userProfile') }}" class="custom-client-edit_profile">
  119.                         <i class="fas fa-cog"></i>
  120.                         <span>{{ getLanguage('edit_profile', 'menu') }}</span>
  121.                     </a>
  122.                     <a href="{{ path('logoff') }}" class="custom-client-sign_out">
  123.                         <i class="fas fa-sign-out-alt"></i>
  124.                         <span>{{ getLanguage('sign_out', 'menu') }}</span>
  125.                     </a>
  126.                 </nav>
  127.             </div>
  128.         </div>
  129.     {% endif %}
  130. </div>