2022-09-13 13:14:49 +00:00
|
|
|
{% from 'macros.twig' import avatar %}
|
|
|
|
{% from '_layout/input.twig' import input_checkbox_raw %}
|
|
|
|
|
2023-05-21 18:15:04 +00:00
|
|
|
{% if current_user_real is defined %}
|
|
|
|
<div class="impersonate">
|
|
|
|
<div class="impersonate-content">
|
2023-08-02 22:12:47 +00:00
|
|
|
<div class="impersonate-user" style="--user-colour: {{ current_user_real_colour }}">
|
2023-05-21 18:15:04 +00:00
|
|
|
You are <a href="{{ url('user-profile', {'user': current_user_real.id}) }}" class="impersonate-user-link">
|
2023-08-02 22:12:47 +00:00
|
|
|
<div class="avatar impersonate-user-avatar">{{ avatar(current_user_real.id, 20, current_user_real.name) }}</div>
|
|
|
|
{{ current_user_real.name }}
|
2023-05-21 18:15:04 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="impersonate-options">
|
|
|
|
<a href="{{ url('auth-revert') }}" class="impersonate-options-link" title="Revert"><i class="fas fa-backward"></i></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-09-13 13:14:49 +00:00
|
|
|
<nav class="header">
|
|
|
|
<div class="header__background"></div>
|
|
|
|
|
|
|
|
<div class="header__desktop">
|
|
|
|
<a class="header__desktop__logo" href="{{ url('index') }}" title="{{ globals.site_name }}">
|
|
|
|
{{ globals.site_name }}
|
|
|
|
</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 %}
|
|
|
|
|
|
|
|
{% if current_user is defined %}
|
2023-08-02 22:12:47 +00:00
|
|
|
<a href="{{ url('user-profile', {'user': current_user.id}) }}" class="avatar header__desktop__user__avatar" title="{{ current_user.name }}">
|
|
|
|
{{ avatar(current_user.id, 60, current_user.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') }}">
|
|
|
|
{{ globals.site_name }}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<label class="header__mobile__icon header__mobile__avatar" for="toggle-mobile-header">
|
2023-08-02 22:12:47 +00:00
|
|
|
{{ avatar(current_user.id|default(0), 40, current_user.name|default('Log in')) }}
|
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>
|