templates/website/includes/menu-mobile-site.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="menu-mobile-box" data-menu-show="site">
  4.     {# SLIDE: INICIAL #}
  5.     <div class="menu-slide" data-slide-id="inicial" data-slide-status="on">
  6.         <header>
  7.             {% if user %}
  8.                 <div>
  9.                     <div class="avatar">
  10.                         {{ imgUpload(user.photo, enum('AbstractEnum::PATH_PROFILES'), 'user-profile-small', user.name) }}
  11.                     </div>
  12.                 </div>
  13.                 <div class="user">
  14.                     <p class="name">{{ user.name }}</p>
  15.                     <a class="link tema--cor-tx js--open-user-opts">
  16.                         {{ getLanguage('options', 'menu') }}&nbsp;{{ ico('chevron-down') }}
  17.                     </a>
  18.                 </div>
  19.             {% endif %}
  20.             {% if user is empty %}
  21.                 <div class="login">
  22.                     <a href="{{ path('login') }}" class="logar">{{ getLanguage('sign_in', 'head') }}</a>
  23.                     <a href="{{ path('register') }}" class="btn-login">{{ getLanguage('create_a_user', 'head') }}</a>
  24.                 </div>
  25.             {% endif %}
  26.             {# MOBILE NOTIFICAÇÕES #}
  27.             {% if user and menuMobileNotificacoes.show %}
  28.                 {# SLIDE #}
  29.                 <button class="btn-notif-mobile" data-slide-nav="{{ menuMobileNotificacoes.link }}">
  30.                     {{ notificon('bell', totalNotifications) }}
  31.                 </button>
  32.             {% endif %}
  33.         </header>
  34.         {# MENU MODULES #}
  35.         <div class="menu-scroll principal">
  36.             {# USER OPTIONS #}
  37.             {% if user %}
  38.                 <div class="user-options js--user-options" data-status="closed">
  39.                     <ul class="menu-lista">
  40.                         {# ACESSO COMO ADMIN #}
  41.                         {% if canAccessAdm %}
  42.                             <li class="menu-item-admin"><a href="{{ path('adminEad') }}"><span><i class="fas fa-cogs"></i>{{ getLanguage('admin', 'menu') }}</span></a></li>
  43.                         {% endif %}
  44.                         {# ADMIN LOGOUT #}
  45.                         {% if session is defined and session and session.userOrigin %}
  46.                             <li class="menu-item-back-admin"><a href="{{ path('userLogoff') }}"><span><i class="fas fa-cogs"></i>{{ getLanguage('back_as_admin', 'menu') }}</span></a></li>
  47.                         {% endif %}
  48.                         
  49.                         <li class="menu-item-enrollment"><a href="{{ path('enrollentList') }}" class="custom-client-enrollments"><span><i class="fas fa-file-alt"></i>{{ getLanguage('enrollments', 'menu') }}</span></a></li>
  50.                         <li class="menu-item-purchases"><a href="{{ path('transactionList') }}" class="custom-client-purchases"><span><i class="fas fa-shopping-bag"></i>{{ getLanguage('purchases', 'menu') }}</span></a></li>
  51.                         {# SUBSCRIPTIONS #}
  52.                         {% if isModuleActive("product_subscription_module") %}
  53.                             <li class="menu-item-subscriptions"><a href="{{ path('userSubscriptionList') }}" class="custom-client-subscriptions"><span><i class="far fa-credit-card"></i>{{ getLanguage('subscriptions', 'menu') }}</span></a></li>
  54.                         {% endif %}
  55.                         <li class="menu-item-messages"><a href="{{ path('message') }}" class="custom-client-messages"><span><i class="fas fa-envelope"></i>{{ getLanguage('messages', 'menu') }}</span></a></li>
  56.                         <li class="menu-item-profile"><a href="{{ path('userProfile') }}" class="custom-client-edit_profile"><span><i class="fas fa-cog"></i>{{ getLanguage('edit_profile', 'menu') }}</span></a></li>
  57.                         <li class="menu-item-logoff"><a href="{{ path('logoff') }}" class="custom-client-sign_out"><span><i class="fas fa-sign-out-alt"></i>{{ getLanguage('sign_out', 'menu') }}</span></a></li>
  58.                     </ul>
  59.                 </div>
  60.             {% endif %}
  61.             <ul class="menu-lista">
  62.                 {% for menuItem in menuMobile %}
  63.                     {% if menuItem.show %}
  64.                         {% set text = menuItem.text|upper %}
  65.                         <li class="menu-item-{{ menuItem.class }}">
  66.                             {# SLIDE #}
  67.                             {% if menuItem.slide ?? false %}
  68.                                 <a data-slide-nav="{{ menuItem.link }}"><span>{{ text }}</span><i>{{ ico('chevron-right') }}</i></a>
  69.                             {# URL #}
  70.                             {% else %}
  71.                                 <a href="{{ menuItem.link }}"><span>{{ text }}</span></a>
  72.                             {% endif %}
  73.                         </li>
  74.                     {% endif %}
  75.                 {% endfor %}
  76.             </ul>
  77.         </div>
  78.     </div>
  79.     {# SLIDE: PAGES #}
  80.     <div class="menu-slide" data-slide-id="pages" data-slide-status="off">
  81.         <header>
  82.             <a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i> 
  83.             <span>{{ getLanguage('pages', 'head')|upper }}</span></a>
  84.         </header>
  85.         {# MENU MODULES #}
  86.         <div class="menu-scroll">
  87.             <ul class="menu-lista">
  88.                 {% for i, page in pages %}
  89.                     {% if page.showType == 1 %}
  90.                         <li class="menu-item-page-{{ page.id }}">
  91.                             <a href="{{ (page.useExternalLink == 1)? page.externalLink : path('pageDetail', { slug:page.slug }) }}"
  92.                                 {% if page.useExternalLink == 1 %}target="_blank"{% endif %}>
  93.                                 <span>{{ page.title|upper }}</span>
  94.                             </a>
  95.                         </li>
  96.                     {% endif %}
  97.                 {% endfor %}
  98.             </ul>
  99.         </div>
  100.     </div>
  101.     {% if hasProducts and categories|length > 0 %}
  102.         {# SLIDE: CATEGORIAS #}
  103.         <div class="menu-slide" data-slide-id="categorias" data-slide-status="off">
  104.             <header>
  105.                 <a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i> 
  106.                 <span>{{ getLanguage('categories', 'head')|upper }}</span></a>
  107.             </header>
  108.             {# MENU MODULES #}
  109.             <div class="menu-scroll">
  110.                 <ul class="menu-lista">
  111.                     {% for category in categories %}
  112.                         {% if category.hasProduct() %}
  113.                             <li class="menu-item-category-{{ category.id }}">
  114.                                 <a href="{{ path('productListCategory', { type: 'produtos', slug: category.slug }) }}">
  115.                                 <span>{{ category.category|upper }}</span></a>
  116.                             </li>
  117.                         {% endif %}
  118.                     {% endfor %}
  119.                 </ul>
  120.             </div>
  121.         </div>
  122.     {% endif %}
  123.     {% if user %}
  124.         {# SLIDE: NOTIFICAÇÕES #}
  125.         <div class="menu-slide" data-slide-id="notificacoes" data-slide-status="off">
  126.             <header>
  127.                 <a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i> 
  128.                 <span>{{ menuMobileNotificacoes.text|upper }}</span></a>
  129.             </header>
  130.             {# MENU MODULES #}
  131.             <div class="fix-notifications fix-notifications-mobile" data-status="off">
  132.                 {% include 'website/includes/fix-notifications.html.twig' %}
  133.             </div>
  134.         </div>
  135.     {% endif %}
  136. {# -/ .menu-mobile-box #}
  137. </div>