From ccfe1f2e1afac31de9d1b2f34ad66ed77a517202 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 11:43:55 +0000 Subject: Handle VERSION on different pages --- wqflask/wqflask/templates/base.html | 2 ++ wqflask/wqflask/templates/error.html | 4 ++-- wqflask/wqflask/views.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index cf40fe3c..210c5708 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -143,7 +143,9 @@

Development and source code on github with issue tracker and documentation. Join the mailing list and find us on IRC (#genenetwork channel). + {% if version: %}

GeneNetwork v{{ version }}

+ {% endif %} diff --git a/wqflask/wqflask/templates/error.html b/wqflask/wqflask/templates/error.html index 7ab2bf2f..c707a4fc 100644 --- a/wqflask/wqflask/templates/error.html +++ b/wqflask/wqflask/templates/error.html @@ -35,7 +35,7 @@

-    {{ stack[0] }}
+    GeneNetwork v{{ version }} {{ stack[0] }}
     {{ message }} (error)
     {{ stack[-3] }}
     {{ stack[-2] }}
@@ -50,7 +50,7 @@
   Toggle full stack trace
   
-      {% for line in stack %} {{ line }}
+      GeneNetwork v{{ version }} {% for line in stack %} {{ line }}
       {% endfor %}
     
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 5528d375..8fbbd2d8 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -108,7 +108,7 @@ def handle_bad_request(e): list = [fn for fn in os.listdir("./wqflask/static/gif/error") if fn.endswith(".gif") ] animation = random.choice(list) - resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation)) + resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation,version=GN_VERSION)) # logger.error("Set cookie %s with %s" % (err_msg, animation)) resp.set_cookie(err_msg[:32],animation) -- cgit v1.2.3