From f0678c3379ee0f00c6ce75a5f5eb320f2d1fa6e0 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Tue, 12 Jun 2018 10:47:53 +1000 Subject: [PATCH] Add the missing navbars to the Jinja2 version of the layout --- lemoncurry/jinja2.py | 8 +++-- lemoncurry/jinja2/lemoncurry/layout.html | 39 ++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/lemoncurry/jinja2.py b/lemoncurry/jinja2.py index 25546af..c459fe5 100644 --- a/lemoncurry/jinja2.py +++ b/lemoncurry/jinja2.py @@ -1,19 +1,23 @@ from django.contrib.staticfiles.storage import staticfiles_storage from django.urls import reverse from jinja2 import Environment -from compressor.contrib.jinja2ext import CompressorExtension +from compressor.contrib.jinja2ext import CompressorExtension +from django_activeurl.ext.django_jinja import ActiveUrl + +from entries.kinds import all as entry_kinds from .utils import load_package_json def environment(**options): env = Environment( - extensions=[CompressorExtension], + extensions=[ActiveUrl, CompressorExtension], trim_blocks=True, lstrip_blocks=True, **options ) env.globals.update({ + 'entry_kinds': entry_kinds, 'package': load_package_json(), 'static': staticfiles_storage.url, 'url': reverse, diff --git a/lemoncurry/jinja2/lemoncurry/layout.html b/lemoncurry/jinja2/lemoncurry/layout.html index c46f232..2d870e5 100644 --- a/lemoncurry/jinja2/lemoncurry/layout.html +++ b/lemoncurry/jinja2/lemoncurry/layout.html @@ -31,8 +31,43 @@ - + {% activeurl %}{% endactiveurl %} +