2018-09-23 19:13:19 +02:00
|
|
|
{% macro toolbar_item(label, link, active_page, icon) %}
|
2021-04-17 14:49:53 +02:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link{% if page() == active_page %} active{% endif %}" href="{{ link }}">
|
2021-07-17 15:31:42 +02:00
|
|
|
{% if icon %}<span class="bi {{ icon }}"></span>{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
{{ label|raw }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2021-04-29 21:58:20 +02:00
|
|
|
<nav class="navbar fixed-top navbar-expand-lg border-bottom {{ theme['navbar_classes'] }}">
|
2018-09-23 19:13:19 +02:00
|
|
|
<div class="container-fluid">
|
2021-04-17 14:49:53 +02:00
|
|
|
<a class="navbar-brand" href="{{ url('/') }}">
|
|
|
|
<span class="icon-icon_angel"></span>
|
|
|
|
<strong class="visible-lg-inline">{{ config('app_name')|upper }}</strong>
|
|
|
|
</a>
|
|
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-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">
|
|
|
|
{{ menu() }}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
{% if config('header_items') %}
|
|
|
|
<ul class="navbar-nav mb-2 mb-lg-0">
|
|
|
|
{% for text,link in config('header_items', {}) %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a href="{{ link|replace({'%lang%': session_get('locale')|split('_')[0]})|escape('html_attr') }}">
|
|
|
|
{{ text }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
|
|
|
|
{% if is_user() %}
|
2021-07-17 15:31:42 +02:00
|
|
|
{{ _self.toolbar_item(menuUserShiftState(user), url('shifts', {'action': 'next'}), '', 'bi-clock') }}
|
2021-04-17 14:49:53 +02:00
|
|
|
{% elseif has_permission_to('register') and config('registration_enabled') %}
|
2021-07-17 15:31:42 +02:00
|
|
|
{{ _self.toolbar_item(__('Register'), url('register'), 'register', 'bi-plus') }}
|
2021-04-17 14:49:53 +02:00
|
|
|
{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
{% if has_permission_to('login') %}
|
2021-07-17 15:31:42 +02:00
|
|
|
{{ _self.toolbar_item(__('Login'), url('login'), 'login', 'bi-box-arrow-in-right') }}
|
2021-04-17 14:49:53 +02:00
|
|
|
{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
{% if is_user() and has_permission_to('user_messages') %}
|
2021-07-17 15:31:42 +02:00
|
|
|
{{ _self.toolbar_item(menuUserMessages(), url('user-messages'), 'user-messages', 'bi-envelope') }}
|
2021-04-17 14:49:53 +02:00
|
|
|
{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
{{ menuUserHints() }}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
{% if has_permission_to('user_myshifts') %}
|
|
|
|
{{ _self.toolbar_item(user.name, url('users', {'action': 'view'}), 'users', 'icon icon-icon_angel') }}
|
|
|
|
{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
|
2021-04-17 14:49:53 +02:00
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
|
|
|
{{ menuUserSubmenu()|join(" ")|raw }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2018-09-23 19:13:19 +02:00
|
|
|
</div>
|
2021-04-17 14:49:53 +02:00
|
|
|
</nav>
|