authsquare/app/templates/prime/html/navbar.html

45 lines
2.4 KiB
HTML

<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">${title}</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">
<ul class="navbar-nav ms-auto">
% for item in menu:
% if any(role in item['roles'] for role in user_roles):
<li class="nav-item">
<a class="nav-link ${'active' if item['name'] == active_page else ''}" href="${item['href']}" target="${item['target']}">
% if item['notification'] > 0:
${item['name']} <sup class="badge bg-danger">${item['notification']}</sup>
% else:
${item['name']}
% endif
</a>
</li>
% endif
% endfor
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<img src="${profile['picture']}" alt="Profile" class="profile-image me-2">
${profile['name']}
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
% for item in profile['menu']:
% if any(role in item['roles'] for role in user_roles):
<li>
<a class="dropdown-item ${'active' if item['name'] == active_page else ''}" href="${item['href']}" target="${item['target']}">
${item['name']}
</a>
</li>
% endif
% endfor
<!-- <li><hr class="dropdown-divider"></li> -->
</ul>
</li>
</ul>
</div>
</div>
</nav>