more flexible navbar code in base template

This commit is contained in:
Patrick Jentsch
2024-05-08 14:01:01 +02:00
parent 4a29a52f2a
commit c68286e010
7 changed files with 76 additions and 54 deletions

View File

@@ -2,6 +2,14 @@
{% set title = 'nopaque' %}
{% endif %}
{% if navbar_fixed is not defined %}
{% set navbar_fixed = true %}
{% endif %}
{% if navbar_extended is not defined %}
{% set navbar_extended = false %}
{% endif %}
{% block doc %}
<!DOCTYPE html>
<html {% block html_attribs %}lang="en"{% endblock html_attribs %}>
@@ -27,9 +35,27 @@
{% block body %}
<header {% block header_attribs %}{% endblock header_attribs %}>
{% block header %}
{% block navbar %}
{% include "_base/navbar.html.j2" %}
{% endblock navbar %}
{% if navbar_fixed %}
<div class="navbar-fixed">
{% endif %}
<nav {% block navbar_attribs %}{% if navbar_extended %}class="nav-extended"{% endif %}{% endblock navbar_attribs %}>
{% block navbar %}
<div {% block navbar_primary_content_attribs %}class="nav-wrapper primary-color"{% endblock navbar_primary_content_attribs %}>
{% block navbar_primary_content %}
{% include "_base/navbar_primary_content.html.j2" %}
{% endblock navbar_primary_content %}
</div>
{% if navbar_extended %}
<div {% block navbar_secondary_content_attribs %}class="nav-content primary-variant-color"{% endblock navbar_secondary_content_attribs %}>
{% block navbar_secondary_content %}
{% endblock navbar_secondary_content %}
</div>
{% endif %}
{% endblock navbar %}
</nav>
{% if navbar_fixed %}
</div>
{% endif %}
{% block sidenav %}
{% if current_user.is_authenticated %}
{% include "_base/sidenav.html.j2" %}
@@ -41,6 +67,7 @@
<main {% block main_attribs %}class="background-color"{% endblock main_attribs %}>
{% block main %}
{% block page_content %}{% endblock page_content %}
{% endblock main %}
<div id="dropdowns">
{% block dropdowns %}
@@ -53,7 +80,6 @@
{% include "_base/modals.html.j2" %}
{% endblock modals %}
</div>
{% endblock main %}
</main>
<footer {% block footer_attribs %}class="page-footer primary-variant-color"{% endblock footer_attribs %}>
@@ -62,9 +88,11 @@
{% endblock footer %}
</footer>
{% block scripts %}
{% include "_base/scripts.html.j2" %}
{% endblock scripts %}
<div id="scripts">
{% block scripts %}
{% include "_base/scripts.html.j2" %}
{% endblock scripts %}
</div>
{% endblock body %}
</body>
{% endblock html %}