From 07b69dab9045aa7b2dd41804ecb0eafd51defdcb Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 22 Feb 2022 12:34:03 +0100 Subject: 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 --- ogcp/templates/dashboard.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ogcp/templates/dashboard.html') 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 %}
-- cgit v1.2.3-18-g5258