migrate basic elements to bs5
Signed-off-by: Michael Weimann <mail@michael-weimann.eu> migrate body color to bs5 Signed-off-by: Michael Weimann <mail@michael-weimann.eu> migrate the nav menu to bs5 Signed-off-by: Michael Weimann <mail@michael-weimann.eu> migrate to bs5 badges Signed-off-by: Michael Weimann <mail@michael-weimann.eu> migrate to bs5 nav pills Signed-off-by: Michael Weimann <mail@michael-weimann.eu> migrate the login page to bs5 Signed-off-by: Michael Weimann <mail@michael-weimann.eu> fix the language dropdown in bs5 Signed-off-by: Michael Weimann <mail@michael-weimann.eu>main
parent
02fa603090
commit
9acaa03a71
@ -1,86 +1,64 @@
|
|||||||
{% macro toolbar_item(label, link, active_page, icon) %}
|
{% macro toolbar_item(label, link, active_page, icon) %}
|
||||||
<li{% if page() == active_page %} class="active"{% endif %}>
|
<li class="nav-item">
|
||||||
<a href="{{ link }}">
|
<a class="nav-link{% if page() == active_page %} active{% endif %}" href="{{ link }}">
|
||||||
{% if icon %}<span class="{% if 'glyphicon-' in icon %}glyphicon {% endif %}{{ icon }}"></span>{% endif %}
|
{% if icon %}<span class="{% if 'bi-' in icon %}bi {% endif %}{{ icon }}"></span>{% endif %}
|
||||||
{{ label|raw }}
|
{{ label|raw }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
<div class="navbar navbar-default navbar-fixed-top">
|
<nav class="navbar fixed-top navbar-expand-lg navbar-dark border-bottom border-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
{% block navbar %}
|
<a class="navbar-brand" href="{{ url('/') }}">
|
||||||
<div class="navbar-header">
|
<span class="icon-icon_angel"></span>
|
||||||
<button type="button"
|
<strong class="visible-lg-inline">{{ config('app_name')|upper }}</strong>
|
||||||
class="navbar-toggle collapsed"
|
</a>
|
||||||
data-toggle="offcanvas"
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
data-target="#navbar-offcanvas"
|
<span class="navbar-toggler-icon"></span>
|
||||||
aria-label="Toggle navigation">
|
</button>
|
||||||
<span class="text-primary glyphicon glyphicon-menu-hamburger icon-open"></span>
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<span class="text-primary glyphicon glyphicon-remove icon-close"></span>
|
{{ menu() }}
|
||||||
</button>
|
|
||||||
<a class="navbar-brand" href="{{ url('/') }}">
|
|
||||||
<span class="icon-icon_angel"></span>
|
|
||||||
<strong class="visible-lg-inline">{{ config('app_name')|upper }}</strong>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% block menu %}
|
|
||||||
<div class="collapse navbar-collapse" id="navbar-offcanvas">
|
|
||||||
{% block menu_items %}
|
|
||||||
{{ menu() }}
|
|
||||||
|
|
||||||
{% 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 %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block menu_toolbar %}
|
|
||||||
<ul class="nav navbar-nav navbar-right">
|
|
||||||
|
|
||||||
{% if is_user() %}
|
{% if config('header_items') %}
|
||||||
{{ _self.toolbar_item(menuUserShiftState(user), url('shifts', {'action': 'next'}), '', 'glyphicon-time') }}
|
<ul class="navbar-nav mb-2 mb-lg-0">
|
||||||
{% elseif has_permission_to('register') and config('registration_enabled') %}
|
{% for text,link in config('header_items', {}) %}
|
||||||
{{ _self.toolbar_item(__('Register'), url('register'), 'register', 'glyphicon-plus') }}
|
<li class="nav-item">
|
||||||
{% endif %}
|
<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() %}
|
||||||
|
{{ _self.toolbar_item(menuUserShiftState(user), url('shifts', {'action': 'next'}), '', 'glyphicon-time') }}
|
||||||
|
{% elseif has_permission_to('register') and config('registration_enabled') %}
|
||||||
|
{{ _self.toolbar_item(__('Register'), url('register'), 'register', 'glyphicon-plus') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if has_permission_to('login') %}
|
{% if has_permission_to('login') %}
|
||||||
{{ _self.toolbar_item(__('Login'), url('login'), 'login', 'glyphicon-log-in') }}
|
{{ _self.toolbar_item(__('Login'), url('login'), 'login', 'glyphicon-log-in') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if is_user() and has_permission_to('user_messages') %}
|
{% if is_user() and has_permission_to('user_messages') %}
|
||||||
{{ _self.toolbar_item(menuUserMessages(), url('user-messages'), 'user-messages', 'glyphicon-envelope') }}
|
{{ _self.toolbar_item(menuUserMessages(), url('user-messages'), 'user-messages', 'glyphicon-envelope') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ menuUserHints() }}
|
{{ menuUserHints() }}
|
||||||
|
|
||||||
{% if has_permission_to('user_myshifts') %}
|
{% if has_permission_to('user_myshifts') %}
|
||||||
{{ _self.toolbar_item(user.name, url('users', {'action': 'view'}), 'users', 'icon icon-icon_angel') }}
|
{{ _self.toolbar_item(user.name, url('users', {'action': 'view'}), 'users', 'icon icon-icon_angel') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<li class="hidden-xs">
|
<li class="nav-item dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<span class="caret"></span>
|
</a>
|
||||||
</a>
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||||
<ul class="dropdown-menu" role="menu">
|
{{ menuUserSubmenu()|join(" ")|raw }}
|
||||||
{{ menuUserSubmenu()|join(" ")|raw }}
|
</ul>
|
||||||
</ul>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
<ul class="nav navbar-nav navbar-mobile hidden-sm hidden-md hidden-lg">
|
|
||||||
{{ menuUserSubmenu()|join(" ")|raw }}
|
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</nav>
|
||||||
|
Loading…
Reference in New Issue