From 2b8f44b7dd1f8cd52d44683a483b7c134848c255 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Sat, 7 Nov 2020 12:15:23 +0100 Subject: [PATCH] Use the new layout template for both the form and the index page. --- cara/apps/calculator/__init__.py | 2 +- .../templates/calculator.form.html.j2 | 2 + cara/apps/templates/index.html.j2 | 38 +++++++++++++++++ cara/apps/templates/layout.html.j2 | 42 +------------------ 4 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 cara/apps/templates/index.html.j2 diff --git a/cara/apps/calculator/__init__.py b/cara/apps/calculator/__init__.py index c231f2e3..b91cafb2 100644 --- a/cara/apps/calculator/__init__.py +++ b/cara/apps/calculator/__init__.py @@ -53,7 +53,7 @@ class LandingPage(RequestHandler): import jinja2 p = Path(__file__).parent.parent / "templates" env = jinja2.Environment(loader=jinja2.FileSystemLoader(Path(p))) - template = env.get_template("layout.html.j2") + template = env.get_template("index.html.j2") report = template.render(**{}) self.finish(report) diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2 index f72d89cc..df4ccb91 100644 --- a/cara/apps/calculator/templates/calculator.form.html.j2 +++ b/cara/apps/calculator/templates/calculator.form.html.j2 @@ -1,5 +1,7 @@ {% extends "layout.html.j2" %} +{% set CALCULATOR_ACTIVE=1 %} + {% block extra_headers %} diff --git a/cara/apps/templates/index.html.j2 b/cara/apps/templates/index.html.j2 new file mode 100644 index 00000000..e4278a43 --- /dev/null +++ b/cara/apps/templates/index.html.j2 @@ -0,0 +1,38 @@ +{% extends "layout.html.j2" %} +{% set HOME_ACTIVE=1 %} + + {% block main %} +
+
+
+
+
+ + +
+

+ CARA: COVID Area Risk Assessment Tools +

+
+

+ Please try out the CARA COVID calculator here. + Your feedback is most welcome at CARA-dev@cern.ch + +

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + + {% endblock main %} diff --git a/cara/apps/templates/layout.html.j2 b/cara/apps/templates/layout.html.j2 index b2e27d6f..61fc4048 100644 --- a/cara/apps/templates/layout.html.j2 +++ b/cara/apps/templates/layout.html.j2 @@ -137,7 +137,7 @@