diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-02-22 12:34:03 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-02-22 12:34:03 +0100 |
commit | 07b69dab9045aa7b2dd41804ecb0eafd51defdcb (patch) | |
tree | a042a2d7792bc8c4c0a981665a40e7ea7b291b8d /ogcp/templates/dashboard.html | |
parent | 5d9ad78ed3a89b4c60c179012fd7b38b22da2b96 (diff) |
Merge nav into base template
{% block %} defined in nav template cannot be overriden by child
templates from base. This is a limitation in jinja.
Merge nav into base template so jinja blocks so no {% include %} is used
and these blocks can be overriden by child templates (commands, images,
dashboard...)
Avoid using request.endpoint to determine active nav item, decoupling
endpoint names from navigation. Instead use child templates to override
jinja blocks.
[1] https://stackoverflow.com/q/40537752
https://stackoverflow.com/a/40562662
https://github.com/pallets/jinja/issues/243
Diffstat (limited to 'ogcp/templates/dashboard.html')
-rw-r--r-- | ogcp/templates/dashboard.html | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html index 21d1d70..75f4cb6 100644 --- a/ogcp/templates/dashboard.html +++ b/ogcp/templates/dashboard.html @@ -1,5 +1,7 @@ {% extends 'base.html' %} +{% block nav_dashboard %}active{% endblock %} + {% block content %} <div class="row"> <!-- connected clients --> |