From 6149e5a7e46509236326781601e4c92e00256851 Mon Sep 17 00:00:00 2001
From: Luis Aleixo
Date: Thu, 8 Jul 2021 12:55:32 +0200
Subject: [PATCH] Merge request fixes: commas and different location for the
new template code
---
cara/apps/calculator/report_generator.py | 2 +-
.../templates/base/calculator.report.html.j2 | 13 +------------
.../themes/cern/templates/calculator.report.html.j2 | 10 ++++++++++
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py
index 966d5de4..6f377157 100644
--- a/cara/apps/calculator/report_generator.py
+++ b/cara/apps/calculator/report_generator.py
@@ -342,7 +342,7 @@ class ReportGenerator:
context = {
'model': model,
'form': form,
- 'creation_date': time
+ 'creation_date': time,
}
context.update(calculate_report_data(model))
diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2
index 3142b36b..a22372cc 100644
--- a/cara/apps/calculator/templates/base/calculator.report.html.j2
+++ b/cara/apps/calculator/templates/base/calculator.report.html.j2
@@ -212,19 +212,8 @@
{% block report_summary %}
Taking into account the uncertainties tied to the model variables, in this scenario, the probability of one exposed occupant getting infected is {{ prob_inf | non_zero_percentage }}[*] and the expected number of new cases is {{ expected_new_cases | float_format }}.
-
- {% if (prob_inf > 5) %}
-
-
-

-
- {{scale_warning.display_text}}
-
-
- {% endif %}
-
- [*] The results are based on the parameters and assumptions published in the CERN Open Report CERN-OPEN-2021-004
{% endblock report_summary %}
+ [*] The results are based on the parameters and assumptions published in the CERN Open Report CERN-OPEN-2021-004
diff --git a/cara/apps/calculator/themes/cern/templates/calculator.report.html.j2 b/cara/apps/calculator/themes/cern/templates/calculator.report.html.j2
index 85d8860b..3c088547 100644
--- a/cara/apps/calculator/themes/cern/templates/calculator.report.html.j2
+++ b/cara/apps/calculator/themes/cern/templates/calculator.report.html.j2
@@ -26,6 +26,16 @@
{{ super() }}
+{% if (prob_inf > 5) %}
+
+
+

+
+ {{scale_warning.display_text}}
+
+
+{% endif %}
+
{% if ((prob_inf > 15) or (expected_new_cases >= 1)) %}
This exceeds the authorised risk threshold or number of expected new cases.
The risk level must be reduced before this activity can be undertaken.