{% from 'utils.html.twig' import ico, imgUpload %}
{% from "website/controls/notification-icon.html.twig" import notificon %}
<div class="menu-mobile-box" data-menu-show="site">
{# SLIDE: INICIAL #}
<div class="menu-slide" data-slide-id="inicial" data-slide-status="on">
<header>
{% if user %}
<div>
<div class="avatar">
{{ imgUpload(user.photo, enum('AbstractEnum::PATH_PROFILES'), 'user-profile-small', user.name) }}
</div>
</div>
<div class="user">
<p class="name">{{ user.name }}</p>
<a class="link tema--cor-tx js--open-user-opts">
{{ getLanguage('options', 'menu') }} {{ ico('chevron-down') }}
</a>
</div>
{% endif %}
{% if user is empty %}
<div class="login">
<a href="{{ path('login') }}" class="logar">{{ getLanguage('sign_in', 'head') }}</a>
<a href="{{ path('register') }}" class="btn-login">{{ getLanguage('create_a_user', 'head') }}</a>
</div>
{% endif %}
{# MOBILE NOTIFICAÇÕES #}
{% if user and menuMobileNotificacoes.show %}
{# SLIDE #}
<button class="btn-notif-mobile" data-slide-nav="{{ menuMobileNotificacoes.link }}">
{{ notificon('bell', totalNotifications) }}
</button>
{% endif %}
</header>
{# MENU MODULES #}
<div class="menu-scroll principal">
{# USER OPTIONS #}
{% if user %}
<div class="user-options js--user-options" data-status="closed">
<ul class="menu-lista">
{# ACESSO COMO ADMIN #}
{% if canAccessAdm %}
<li class="menu-item-admin"><a href="{{ path('adminEad') }}"><span><i class="fas fa-cogs"></i>{{ getLanguage('admin', 'menu') }}</span></a></li>
{% endif %}
{# ADMIN LOGOUT #}
{% if session is defined and session and session.userOrigin %}
<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>
{% endif %}
<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>
<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>
{# SUBSCRIPTIONS #}
{% if isModuleActive("product_subscription_module") %}
<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>
{% endif %}
<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>
<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>
<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>
</ul>
</div>
{% endif %}
<ul class="menu-lista">
{% for menuItem in menuMobile %}
{% if menuItem.show %}
{% set text = menuItem.text|upper %}
<li class="menu-item-{{ menuItem.class }}">
{# SLIDE #}
{% if menuItem.slide ?? false %}
<a data-slide-nav="{{ menuItem.link }}"><span>{{ text }}</span><i>{{ ico('chevron-right') }}</i></a>
{# URL #}
{% else %}
<a href="{{ menuItem.link }}"><span>{{ text }}</span></a>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{# SLIDE: PAGES #}
<div class="menu-slide" data-slide-id="pages" data-slide-status="off">
<header>
<a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i>
<span>{{ getLanguage('pages', 'head')|upper }}</span></a>
</header>
{# MENU MODULES #}
<div class="menu-scroll">
<ul class="menu-lista">
{% for i, page in pages %}
{% if page.showType == 1 %}
<li class="menu-item-page-{{ page.id }}">
<a href="{{ (page.useExternalLink == 1)? page.externalLink : path('pageDetail', { slug:page.slug }) }}"
{% if page.useExternalLink == 1 %}target="_blank"{% endif %}>
<span>{{ page.title|upper }}</span>
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% if hasProducts and categories|length > 0 %}
{# SLIDE: CATEGORIAS #}
<div class="menu-slide" data-slide-id="categorias" data-slide-status="off">
<header>
<a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i>
<span>{{ getLanguage('categories', 'head')|upper }}</span></a>
</header>
{# MENU MODULES #}
<div class="menu-scroll">
<ul class="menu-lista">
{% for category in categories %}
{% if category.hasProduct() %}
<li class="menu-item-category-{{ category.id }}">
<a href="{{ path('productListCategory', { type: 'produtos', slug: category.slug }) }}">
<span>{{ category.category|upper }}</span></a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if user %}
{# SLIDE: NOTIFICAÇÕES #}
<div class="menu-slide" data-slide-id="notificacoes" data-slide-status="off">
<header>
<a class="link-back" data-slide-nav="inicial" data-slide-back><i>{{ ico('chevron-left') }}</i>
<span>{{ menuMobileNotificacoes.text|upper }}</span></a>
</header>
{# MENU MODULES #}
<div class="fix-notifications fix-notifications-mobile" data-status="off">
{% include 'website/includes/fix-notifications.html.twig' %}
</div>
</div>
{% endif %}
{# -/ .menu-mobile-box #}
</div>