2025-01-08 18:06:08 +01:00
|
|
|
<!-- Template for Subitems -->
|
|
|
|
{% macro render_subitems(subitems) %}
|
|
|
|
{% for subitem in subitems %}
|
2025-01-08 22:02:15 +01:00
|
|
|
{% if subitem.subitems %}
|
2025-01-09 14:42:38 +01:00
|
|
|
<li class="dropdown-submenu position-relative">
|
2025-01-14 17:08:59 +01:00
|
|
|
<a class="dropdown-item dropdown-toggle" title="{{ subitem.description }}">
|
2025-01-10 13:56:37 +01:00
|
|
|
{% if subitem.icon is defined and subitem.icon.class is defined %}
|
|
|
|
<i class="{{ subitem.icon.class }}"></i> {{ subitem.name }}
|
|
|
|
{% else %}
|
|
|
|
<p>Missing icon in subitem: {{ subitem }}</p>
|
|
|
|
{% endif %}
|
2025-01-08 18:06:08 +01:00
|
|
|
</a>
|
2025-01-09 14:42:38 +01:00
|
|
|
<ul class="dropdown-menu">
|
2025-01-08 18:06:08 +01:00
|
|
|
{{ render_subitems(subitem.subitems) }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
2025-01-10 11:45:22 +01:00
|
|
|
{% elif subitem.identifier or subitem.warning or subitem.info %}
|
2025-01-08 18:06:08 +01:00
|
|
|
<li>
|
2025-01-09 14:36:44 +01:00
|
|
|
<a class="dropdown-item" onclick='openDynamicPopup({{ subitem|tojson|safe }})' data-bs-toggle="tooltip" title="{{ subitem.description }}">
|
2025-01-09 12:20:57 +01:00
|
|
|
<i class="{{ subitem.icon.class }}"></i> {{ subitem.name }}
|
2025-01-08 18:06:08 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<li>
|
2025-01-09 14:59:30 +01:00
|
|
|
<a class="dropdown-item" href="{{ subitem.url }}" target="{{ subitem.target|default('_blank') }}" data-bs-toggle="tooltip" title="{{ subitem.description }}">
|
2025-01-09 14:36:44 +01:00
|
|
|
{% if subitem.icon is defined and subitem.icon.class is defined %}
|
|
|
|
<i class="{{ subitem.icon.class }}"></i> {{ subitem.name }}
|
|
|
|
{% else %}
|
2025-01-10 11:45:22 +01:00
|
|
|
<p>Missing icon in subitem: {{ subitem }}</p>
|
2025-01-09 14:36:44 +01:00
|
|
|
{% endif %}
|
2025-01-08 18:06:08 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endmacro %}
|
2025-01-14 17:08:59 +01:00
|
|
|
<!-- Navigation Bar -->
|
2025-01-08 17:09:45 +01:00
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
|
|
<div class="container-fluid">
|
2025-01-09 09:48:56 +01:00
|
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav{{menu_type}}" aria-controls="navbarNav{{menu_type}}" aria-expanded="false" aria-label="Toggle navigation">
|
2025-01-08 17:09:45 +01:00
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
2025-01-09 09:48:56 +01:00
|
|
|
<div class="collapse navbar-collapse" id="navbarNav{{menu_type}}">
|
2025-01-08 19:37:24 +01:00
|
|
|
<ul class="navbar-nav {% if menu_type == 'header' %}ms-auto{% endif %}">
|
|
|
|
{% for item in navigation[menu_type] %}
|
2025-01-09 14:59:30 +01:00
|
|
|
{% if item.url %}
|
2025-01-08 17:09:45 +01:00
|
|
|
<!-- Single Item -->
|
|
|
|
<li class="nav-item">
|
2025-01-09 14:59:30 +01:00
|
|
|
<a class="nav-link" href="{{ item.url }}" target="{{ item.target|default('_blank') }}" data-bs-toggle="tooltip" title="{{ item.description }}">
|
2025-01-09 12:20:57 +01:00
|
|
|
<i class="{{ item.icon.class }}"></i> {{ item.name }}
|
2025-01-08 17:09:45 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<!-- Dropdown Menu -->
|
|
|
|
<li class="nav-item dropdown">
|
2025-01-14 17:08:59 +01:00
|
|
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown{{ loop.index }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
2025-01-10 11:45:22 +01:00
|
|
|
{% if item.icon is defined and item.icon.class is defined %}
|
2025-01-14 17:08:59 +01:00
|
|
|
<i class="{{ item.icon.class }}"></i> {{ item.name }}
|
2025-01-10 11:45:22 +01:00
|
|
|
{% else %}
|
|
|
|
<p>Missing icon in item: {{ item }}</p>
|
|
|
|
{% endif %}
|
2025-01-08 17:09:45 +01:00
|
|
|
</a>
|
2025-01-14 17:08:59 +01:00
|
|
|
<ul class="dropdown-menu">
|
2025-01-08 17:09:45 +01:00
|
|
|
{{ render_subitems(item.subitems) }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-01-14 17:08:59 +01:00
|
|
|
</nav>
|