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/base.html | 49 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'ogcp/templates/base.html') diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 68e2e64..c6c3e3b 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -15,8 +15,53 @@
- {% include 'nav.html' %} - {% block nav %}{% endblock %} +
{% block container %}
-- cgit v1.2.3-18-g5258