2022-09-13 13:14:49 +00:00
|
|
|
{% from 'macros.twig' import avatar %}
|
|
|
|
{% from '_layout/input.twig' import input_checkbox_raw %}
|
|
|
|
|
2023-08-31 21:33:34 +00:00
|
|
|
{% if globals.auth_info.isImpersonating %}
|
|
|
|
{% set real_user_info = globals.auth_info.realUserInfo %}
|
2023-05-21 18:15:04 +00:00
|
|
|
<div class="impersonate">
|
|
|
|
<div class="impersonate-content">
|
2023-08-31 21:33:34 +00:00
|
|
|
<div class="impersonate-user">
|
|
|
|
You are <a href="{{ url('user-profile', {'user': real_user_info.id}) }}" class="impersonate-user-link">
|
|
|
|
<div class="avatar impersonate-user-avatar">{{ avatar(real_user_info.id, 20, real_user_info.name) }}</div>
|
|
|
|
{{ real_user_info.name }}
|
2023-05-21 18:15:04 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="impersonate-options">
|
2023-09-10 20:02:11 +00:00
|
|
|
<a href="{{ url('auth-revert', { csrf: csrf_token() }) }}" class="impersonate-options-link" title="Revert"><i class="fas fa-backward"></i></a>
|
2023-05-21 18:15:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2023-08-31 21:33:34 +00:00
|
|
|
{% set is_in_manage = is_in_manage|default(false) %}
|
|
|
|
{% set header_menu = msz_header_menu() %}
|
|
|
|
{% set user_menu = msz_user_menu(is_in_manage, (is_in_manage ? site_link|default('') : manage_link|default(''))) %}
|
|
|
|
|
2022-09-13 13:14:49 +00:00
|
|
|
<nav class="header">
|
|
|
|
<div class="header__background"></div>
|
|
|
|
|
|
|
|
<div class="header__desktop">
|
2023-09-08 20:40:48 +00:00
|
|
|
<a class="header__desktop__logo" href="{{ url('index') }}" title="{{ globals.site_info.name }}">
|
|
|
|
{{ globals.site_info.name }}
|
2022-09-13 13:14:49 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="header__desktop__menus">
|
2023-08-02 22:12:47 +00:00
|
|
|
{% for item in header_menu %}
|
|
|
|
<div class="header__desktop__menu">
|
|
|
|
<a href="{{ item.url }}" class="header__desktop__link header__desktop__menu__link">{{ item.title }}</a>
|
2022-09-13 13:14:49 +00:00
|
|
|
|
2023-08-02 22:12:47 +00:00
|
|
|
{% if item.menu is defined and item.menu is iterable %}
|
|
|
|
<div class="header__desktop__submenu">
|
|
|
|
<div class="header__desktop__submenu__background"></div>
|
|
|
|
<div class="header__desktop__submenu__content">
|
|
|
|
{% for subitem in item.menu %}
|
|
|
|
<a href="{{ subitem.url }}" class="header__desktop__link header__desktop__submenu__link">{{ subitem.title }}</a>
|
|
|
|
{% endfor %}
|
2022-09-13 13:14:49 +00:00
|
|
|
</div>
|
2023-08-02 22:12:47 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-09-13 13:14:49 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="header__desktop__user">
|
|
|
|
{% for item in user_menu %}
|
2023-08-02 22:12:47 +00:00
|
|
|
<a href="{{ item.url }}" title="{{ item.title }}" class="header__desktop__user__button {{ item.class|default('') }}">
|
|
|
|
<i class="{{ item.icon }}"></i>
|
|
|
|
</a>
|
2022-09-13 13:14:49 +00:00
|
|
|
{% endfor %}
|
|
|
|
|
2023-08-31 21:33:34 +00:00
|
|
|
{% if globals.auth_info.isLoggedIn %}
|
|
|
|
{% set user_info = globals.auth_info.userInfo %}
|
|
|
|
<a href="{{ url('user-profile', {'user': user_info.id}) }}" class="avatar header__desktop__user__avatar" title="{{ user_info.name }}">
|
|
|
|
{{ avatar(user_info.id, 60, user_info.name) }}
|
2022-09-13 13:14:49 +00:00
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ url('auth-login') }}" class="avatar header__desktop__user__avatar">
|
|
|
|
{{ avatar(0, 60, 'Log in') }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="header__mobile">
|
|
|
|
<div class="header__mobile__icons">
|
|
|
|
<label class="header__mobile__icon" for="toggle-mobile-header">
|
|
|
|
<i class="fas fa-bars"></i>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<a class="header__mobile__logo header__mobile__icon" href="{{ url('index') }}">
|
2023-09-08 20:40:48 +00:00
|
|
|
{{ globals.site_info.name }}
|
2022-09-13 13:14:49 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<label class="header__mobile__icon header__mobile__avatar" for="toggle-mobile-header">
|
2023-08-31 21:33:34 +00:00
|
|
|
{% if globals.auth_info.isLoggedIn %}
|
|
|
|
{% set user_info = globals.auth_info.userInfo %}
|
|
|
|
{{ avatar(user_info.id, 40, user_info.name) }}
|
|
|
|
{% else %}
|
|
|
|
{{ avatar(0, 40, 'Log in') }}
|
|
|
|
{% endif %}
|
2022-09-13 13:14:49 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{ input_checkbox_raw('', false, 'header__mobile__toggle', '', false, {'id':'toggle-mobile-header'}) }}
|
|
|
|
<div class="header__mobile__menu">
|
|
|
|
<div class="header__mobile__menu__spacer"></div>
|
|
|
|
|
|
|
|
<div class="header__mobile__user">
|
|
|
|
{% for item in user_menu %}
|
2023-08-02 22:12:47 +00:00
|
|
|
<a href="{{ item.url }}" class="header__mobile__link header__mobile__link--user {{ item.class|default('') }}">
|
|
|
|
<i class="{{ item.icon }}"></i> {{ item.title }}
|
|
|
|
</a>
|
2022-09-13 13:14:49 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="header__mobile__navigation">
|
2023-08-02 22:12:47 +00:00
|
|
|
{% for item in header_menu %}
|
|
|
|
<a href="{{ item.url }}" class="header__mobile__link header__mobile__link--primary">{{ item.title }}</a>
|
2022-09-13 13:14:49 +00:00
|
|
|
|
2023-08-02 22:12:47 +00:00
|
|
|
{% if item.menu is defined and item.menu is iterable %}
|
|
|
|
{% for subitem in item.menu %}
|
|
|
|
<a href="{{ subitem.url }}" class="header__mobile__link">{{ subitem.title }}</a>
|
|
|
|
{% endfor %}
|
2022-09-13 13:14:49 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|