<nav id="sidebar" class="sidebar collapse d-md-flex flex-shrink-0 flex-column bg-dark overflow-auto max-h-before-header">
	<ul class="nav d-flex flex-fill flex-column py-3">
		{% for idx,mitems in nav_entries %}
			{% if mitems.items is not empty %}
				<li class="nav-item" {% if mitems.active == 1 %}aria-current="page"{% endif %}>
					<a class="nav-link text-light {% if mitems.active == 0 %}collapsed{% endif %}" href="#sub{{ idx }}" data-bs-toggle="collapse" data-bs-target="#sub{{ idx }}">
						{% if mitems.icon is not empty %}
							<i class="{{ mitems.icon }}"></i>
						{% endif %}
						{{ mitems.label }}
					</a>
					<div class="collapse {% if mitems.active == 1 %}show{% endif %}" id="sub{{ idx }}" aria-expanded="{% if mitems.active == 1 %}true{% else %}false{% endif %}">
						<ul class="flex-column ps-3 nav">
							{% for item in mitems.items %}
								<li class="nav-item d-flex justify-content-between align-items-center" {% if item.active == 1 %}aria-current="page"{% endif %}>
									<div class="me-auto">
										<a class="nav-link text-light {% if item.active == 1 %}active fw-bold{% endif %}" href="{{ item.url|raw }}" {% if item.is_external is defined and item.is_external %}target="_blank"{% endif %}>{{ item.label|raw }}</a>
									</div>
									{% if item.add_shortlink is defined and item.add_shortlink is not empty %}
										<a href="{{ item.add_shortlink|raw }}" class="text-secondary me-2"><i class="fa-solid fa-plus-circle"></i></a>
									{% endif %}
									{% if item.is_external is defined and item.is_external %}
										<span class="me-2"><i class="fa-solid fa-arrow-up-right-from-square"></i></span>
									{% endif %}
								</li>
							{% endfor %}
						</ul>
					</div>
				</li>
			{% else %}
				<li class="nav-item" {% if mitems.active == 1 %}aria-current="page"{% endif %}>
					<a class="nav-link text-light {% if mitems.active == 1 %}active{% endif %}" href="{% if mitems.url is not empty %}{{ mitems.url|raw }}{% else %}#{% endif %}" {% if mitems.target is not empty %} target="{{ mitems.target }}" {% endif %}>
						{% if mitems.icon is not empty %}
							<i class="{{ mitems.icon }}"></i>
						{% endif %}
						{{ mitems.label|upper }}
					</a>
				</li>
			{% endif %}
		{% endfor %}
	</ul>
</nav>
