Initial commit
This commit is contained in:
commit
49b228c1a5
8 changed files with 287 additions and 0 deletions
31
templates/navbar.html
Normal file
31
templates/navbar.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{% macro navbar() %}
|
||||
|
||||
{% set pages = [
|
||||
{"endpoint": "root_page", "label": "Home" },
|
||||
{"endpoint": "login_page", "label": "Login" },
|
||||
] %}
|
||||
{% set project = "Auth" %}
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-md bg-success" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="{{ url_for("root_page") }}">{{ project }}</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
{% for page in pages %}
|
||||
{% set is_active = request.endpoint == page.endpoint %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link{% if is_active %} border border-white border-2 active{% endif %}" {% if is_active %} aria-current="page"{% endif %} href="{{ url_for(page.endpoint) }}">
|
||||
{{ page.label }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% endmacro %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue