2018-09-23 19:13:19 +02:00
|
|
|
{% macro toolbar_item(label, link, active_page, icon) %}
|
|
|
|
<li{% if page() == active_page %} class="active"{% endif %}>
|
|
|
|
<a href="{{ link }}">
|
2018-10-03 09:23:30 +02:00
|
|
|
{% if icon %}<span class="{% if 'glyphicon-' in icon %}glyphicon {% endif %}{{ icon }}"></span>{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
{{ label|raw }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
<div class="navbar navbar-default navbar-fixed-top">
|
|
|
|
<div class="container-fluid">
|
|
|
|
{% block navbar %}
|
|
|
|
<div class="navbar-header">
|
2021-03-26 16:42:41 +01:00
|
|
|
<button type="button"
|
|
|
|
class="navbar-toggle collapsed"
|
|
|
|
data-toggle="offcanvas"
|
|
|
|
data-target="#navbar-offcanvas"
|
|
|
|
aria-label="Toggle navigation">
|
|
|
|
<span class="text-primary glyphicon glyphicon-menu-hamburger icon-open"></span>
|
|
|
|
<span class="text-primary glyphicon glyphicon-remove icon-close"></span>
|
2018-09-23 19:13:19 +02:00
|
|
|
</button>
|
|
|
|
<a class="navbar-brand" href="{{ url('/') }}">
|
2018-10-08 19:30:37 +02:00
|
|
|
<span class="icon-icon_angel"></span>
|
|
|
|
<strong class="visible-lg-inline">{{ config('app_name')|upper }}</strong>
|
2018-09-23 19:13:19 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% block menu %}
|
2019-12-30 14:06:07 +01:00
|
|
|
<div class="collapse navbar-collapse" id="navbar-offcanvas">
|
2018-09-23 19:13:19 +02:00
|
|
|
{% block menu_items %}
|
|
|
|
{{ menu() }}
|
2019-12-28 21:46:52 +01:00
|
|
|
|
|
|
|
{% if config('header_items') %}
|
|
|
|
<ul class="nav navbar-nav">
|
|
|
|
{% for text,link in config('header_items', {}) %}
|
|
|
|
<li>
|
|
|
|
<a href="{{ link|replace({'%lang%': session_get('locale')|split('_')[0]})|escape('html_attr') }}">
|
|
|
|
{{ text }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block menu_toolbar %}
|
|
|
|
<ul class="nav navbar-nav navbar-right">
|
|
|
|
|
|
|
|
{% if is_user() %}
|
2019-03-16 22:02:36 +01:00
|
|
|
{{ _self.toolbar_item(menuUserShiftState(user), url('shifts', {'action': 'next'}), '', 'glyphicon-time') }}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% elseif has_permission_to('register') and config('registration_enabled') %}
|
2019-03-16 22:02:36 +01:00
|
|
|
{{ _self.toolbar_item(__('Register'), url('register'), 'register', 'glyphicon-plus') }}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if has_permission_to('login') %}
|
2019-03-16 22:02:36 +01:00
|
|
|
{{ _self.toolbar_item(__('Login'), url('login'), 'login', 'glyphicon-log-in') }}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if is_user() and has_permission_to('user_messages') %}
|
2019-03-16 22:02:36 +01:00
|
|
|
{{ _self.toolbar_item(menuUserMessages(), url('user-messages'), 'user-messages', 'glyphicon-envelope') }}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{{ menuUserHints() }}
|
|
|
|
|
|
|
|
{% if has_permission_to('user_myshifts') %}
|
2019-03-16 22:02:36 +01:00
|
|
|
{{ _self.toolbar_item(user.name, url('users', {'action': 'view'}), 'users', 'icon icon-icon_angel') }}
|
2018-09-23 19:13:19 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2019-12-30 14:06:07 +01:00
|
|
|
<li class="hidden-xs">
|
2019-10-06 16:53:10 +02:00
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
|
|
<span class="caret"></span>
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
{{ menuUserSubmenu()|join(" ")|raw }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
2019-12-30 14:06:07 +01:00
|
|
|
</ul>
|
|
|
|
<ul class="nav navbar-nav navbar-mobile hidden-sm hidden-md hidden-lg">
|
|
|
|
{{ menuUserSubmenu()|join(" ")|raw }}
|
2018-09-23 19:13:19 +02:00
|
|
|
</ul>
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
</div>
|