<nav id="top-navbar" class="navbar navbar-expand-lg navbar-dark bg-primary pt-0 pb-0">
{% set sitename = get_setting('core_site_name') %}
<a class="navbar-brand" href="{{ path('home') }}" title="{{ sitename }}">
<img src="{{ asset(get_setting('core_site_logo')) }}" alt="{{ sitename }}" class="site-logo" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
{#<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{{ path('profile_index') }}">{% trans %}My profiles{% endtrans %}</a>
</li>
</ul>
#}
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<div class="custom-control nav-link custom-switch">
{% set safeMode = true %}
{% if app.user %}
{% set safeMode = app.user.safeMode %}
{% else %}
{% if app.request.cookies.get('safeMode') %}
{% set safeMode = false %}
{% endif %}
{% endif %}
<input{% if safeMode %} checked="checked"{% endif %} data-responder="{{ path('core_safe_mode') }}" type="checkbox" class="custom-control-input" id="safe-mode">
<label class="custom-control-label safe-mode" for="safe-mode">{{ 'Safe mode'|trans({}, 'core_navbar') }}</label>
</div>
</li>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="add-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus" aria-hidden="true"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="add-menu">
{{ get_menu(3, 2)|raw }}
</div>
</li>
{% if is_money_enabled() %}
{% set defaultCurrency = get_currency() %}
<li class="nav-item">
<a class="nav-link" href="{{ path('wallet') }}">
<i class="fa fa-money" aria-hidden="true"></i> {{ 'Walet'|trans({}, 'core_navbar') }}
<span data-toggle="tooltip" title="{{ 'Your account balance: {balance}'|trans({'{balance}': app.user.wallet.balance|format_currency(defaultCurrency.isoCode)}, 'core_navbar') }}" class="badge badge-pill bg-success text-dark align-text-center">
{{ app.user.wallet.balance|format_currency(defaultCurrency.isoCode) }}
</span>
</a>
</li>
{% endif %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="user-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-user" aria-hidden="true"></i> {{ app.user.displayName }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="user-menu">
{{ get_menu(2, 2)|raw }}
{% if is_granted('IS_IMPERSONATOR') %}
<a class="dropdown-item" href="{{ impersonation_exit_path('impersonate') }}">
{{ 'Exit impersonation'|trans({}, 'core_navbar') }}
</a>
{% endif %}
</div>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ path('login') }}"><i class="bi bi-box-arrow-in-right"></i> {{ 'Log in'|trans({}, 'core_navbar') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ path('app_register') }}"><i class="bi bi-box-arrow-up"></i> {{ 'Register'|trans({}, 'core_navbar') }}</a>
</li>
{% endif %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="admin-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search" aria-hidden="true"></i> <span class="d-md-none">{{ 'Search'|trans({}, 'core_navbar') }}</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="admin-menu">
<div class="dropdown-item">
<div class="row">
<div class="p-0 col-10 col-lg-9">
<input type="text" data-responder="{{ path('profile_responder') }}" id="quick-search-profile" name="profile" class="form-control" placeholder="{{ 'Name...'|trans({}, 'core_navbar') }}">
</div>
<div class="p-0 col-2 col-lg-3">
<button data-url="{{ path('profile_search') }}" class="btn btn-block btn-primary" id="btn-search"><i class="fa fa-search" aria-hidden="true"></i></button>
</div>
</div>
</div>
<a class="dropdown-item" href="{{ path('profile_search') }}">
{{ 'Advanced'|trans({}, 'core_navbar') }}
</a>
</div>
</li>
{% if app.user and is_granted('ROLE_ADMIN') %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="admin-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-tools" aria-hidden="true"></i> <span class="d-md-none">{{ 'Admin'|trans({}, 'core_navbar') }}</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="admin-menu">
<a class="dropdown-item" href="{{ path('super_admin_dashboard') }}">
<i class="fa fa-users-cog" aria-hidden="true"></i> {{ 'Admin Panel'|trans({}, 'core_navbar') }}
</a>
{% if is_granted('IS_IMPERSONATOR') %}
<a class="dropdown-item" href="{{ impersonation_exit_path('impersonate') }}">
{{ 'Exit impersonation'|trans({}, 'core_navbar') }}
</a>
{% elseif is_granted('ROLE_ALLOWED_TO_SWITCH') %}
<a class="dropdown-item" href="{{ path('impersonate') }}">
{{ 'Impersonate a user'|trans({}, 'core_navbar') }}
</a>
{% endif %}
</div>
</li>
{% endif %}
</ul>
</div>
</nav>