From e618f06d11cef0aa3141b33010a618ecd1a603ad Mon Sep 17 00:00:00 2001 From: s3lph Date: Mon, 9 Jul 2018 22:41:58 +0200 Subject: [PATCH] Included version number in base template. --- matemat/webserver/responses.py | 4 +++- templates/base.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/matemat/webserver/responses.py b/matemat/webserver/responses.py index f1e7f90..6f0308f 100644 --- a/matemat/webserver/responses.py +++ b/matemat/webserver/responses.py @@ -1,6 +1,8 @@ from jinja2 import Environment, Template +from matemat import __version__ + class PageletResponse: """ @@ -60,4 +62,4 @@ class TemplateResponse(PageletResponse): :return: An UTF-8 encoded bytes object containing the template rendering result. """ template: Template = jinja_env.get_template(self.name) - return template.render(**self.kwargs).encode('utf-8') + return template.render(**self.kwargs, __version__=__version__).encode('utf-8') diff --git a/templates/base.html b/templates/base.html index 98151db..6d4e379 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,7 +27,7 @@