homepage.veen.world/app/templates/moduls/navigation.html.j2

63 lines
3.1 KiB
Plaintext
Raw Normal View History

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-08 18:06:08 +01:00
<li class="dropdown-submenu">
2025-01-08 22:15:36 +01:00
<a class="dropdown-item" title="{{ subitem.description }}">
2025-01-08 18:06:08 +01:00
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
</a>
2025-01-08 22:02:15 +01:00
<ul class="dropdown-submenu">
2025-01-08 18:06:08 +01:00
{{ render_subitems(subitem.subitems) }}
</ul>
</li>
{% elif subitem.popup %}
<li>
2025-01-08 20:17:32 +01:00
<a class="dropdown-item" onclick='openDynamicPopup({{subitem|tojson|safe}})' data-bs-toggle="tooltip" title="{{ subitem.description }}">
2025-01-08 18:06:08 +01:00
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
</a>
</li>
{% else %}
<li>
2025-01-08 20:17:32 +01:00
<a class="dropdown-item" href="{{ subitem.href }}" target="{{ subitem.target|default('_blank') }}" data-bs-toggle="tooltip" title="{{ subitem.description }}">
2025-01-08 18:06:08 +01:00
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}
2025-01-08 17:09:45 +01:00
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<!--
<a class="navbar-brand" href="#">Navbar</a>
-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
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-08 17:09:45 +01:00
{% if item.href %}
<!-- Single Item -->
<li class="nav-item">
2025-01-08 20:17:32 +01:00
<a class="nav-link" href="{{ item.href }}" target="{{ item.target|default('_blank') }}" data-bs-toggle="tooltip" title="{{ item.description }}">
2025-01-08 17:09:45 +01:00
<i class="{{ item.icon_class }}"></i> {{ item.name }}
</a>
</li>
{% else %}
<!-- Dropdown Menu -->
<li class="nav-item dropdown">
2025-01-08 22:02:15 +01:00
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown{{ loop.index }}" role="button" data-bs-toggle="dropdown" data-bs-display="dynamic" data-popper-placement="top" title="{{ item.description }}" aria-expanded="false">
<i class="{{ item.icon_class }}" data-bs-toggle="tooltip"></i> {{ item.name }}
2025-01-08 17:09:45 +01:00
</a>
2025-01-08 22:02:15 +01:00
<ul class="dropdown-menu dropdown-menu-{{menu_type}}" aria-labelledby="navbarDropdown{{ loop.index }}">
2025-01-08 17:09:45 +01:00
{{ render_subitems(item.subitems) }}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
2025-01-08 18:06:08 +01:00
</nav>