diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index 56ba86bc..f3d4a2a9 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -432,9 +432,9 @@ function draw_plot(svg_id) { if (show_sr_legend) { sr_unique_activities.forEach((b, index) => { legendShortRangeAreaIcon[index].attr('x', legend_x_start) - .attr('y', graph_height + 4 * size - 15/2); + .attr('y', graph_height + (4 + index) * size - 15/2); legendShortRangeText[index].attr('x', legend_x_start + space_between_text_icon) - .attr('y', graph_height + 4 * size + text_height); + .attr('y', graph_height + (4 + index) * size + text_height); }); legendLongCumulativeIcon.attr("x1", legend_x_start) .attr("x2", legend_x_start + 20) diff --git a/cara/apps/static/images/1.png b/cara/apps/static/images/1.png new file mode 100644 index 00000000..57c712f1 Binary files /dev/null and b/cara/apps/static/images/1.png differ diff --git a/cara/apps/static/images/2.png b/cara/apps/static/images/2.png new file mode 100644 index 00000000..ff6efbc7 Binary files /dev/null and b/cara/apps/static/images/2.png differ diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index 45a8ff0d..0d1f64da 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -59,36 +59,70 @@

-
-
-
Probability of infection (%)
-
- {% block warning_animation %} -
- {{prob_inf | non_zero_percentage}} - - - - -
- {% endblock warning_animation %} +
+
+ Probability of infection (%)
+ {% if form.short_range_option == "short_range_yes" %} Without short range interactions {% endif %} +
+
+ +
+ {% block long_range_warning_animation %} +
+ {{long_range_prob_inf | non_zero_percentage}} + + + + +
+ {% endblock long_range_warning_animation %} +
-
-
+
+ {% if form.short_range_option == "short_range_yes" %} +
+
+ Probability of infection (%)
+ With short range interactions +
+
+ +
+ {% block warning_animation %} +
+ {{prob_inf | non_zero_percentage}} + + + + +
+ {% endblock warning_animation %} +
+
+ {% endif %} +
{% block report_summary %} -
-

{% block report_summary_footnote %} {% endblock report_summary_footnote %}
-

* The results are based on the parameters and assumptions published in the CARA publication: doi.org/10.1098/rsfs.2021.0076.


+

* The results are based on the parameters and assumptions published in the CARA publication: doi.org/10.1098/rsfs.2021.0076.


{% if form.short_range_option == "short_range_yes" %} {% if 'Speaking' in form.short_range_interactions|string or 'Shouting' in form.short_range_interactions|string %} diff --git a/cara/apps/templates/cern/calculator.report.html.j2 b/cara/apps/templates/cern/calculator.report.html.j2 index 11c6f5c2..495b1401 100644 --- a/cara/apps/templates/cern/calculator.report.html.j2 +++ b/cara/apps/templates/cern/calculator.report.html.j2 @@ -1,6 +1,12 @@ {% extends "base/calculator.report.html.j2" %} {% set cern_level = 'green-1' %} + +{% if ((long_range_prob_inf > 10) or (long_range_expected_new_cases >= 1)) %} {% set long_range_scale_warning = 'red' %} +{% elif (2 <= long_range_prob_inf <= 10) %} {% set long_range_scale_warning = 'orange' %} +{% else %} {% set long_range_scale_warning = 'green' %} +{% endif %} + {% if ((prob_inf > 10) or (expected_new_cases >= 1)) %} {% set scale_warning = 'red' %} {% elif (2 <= prob_inf <= 10) %} {% set scale_warning = 'orange' %} {% else %} {% set scale_warning = 'green' %} @@ -12,12 +18,25 @@ {% endblock report_preamble_navtab %} +{% block long_range_warning_animation %} + {% if long_range_scale_warning == 'red' %} {% set long_range_warning_color= 'bg-danger' %} + {% elif long_range_scale_warning == 'orange' %} {% set long_range_warning_color = 'bg-warning' %} + {% elif long_range_scale_warning == 'green' %} {% set long_range_warning_color = 'bg-success' %} + {% endif %} +
+ {{long_range_prob_inf | non_zero_percentage}} + + + + +
+{% endblock long_range_warning_animation %} + {% block warning_animation %} {% if scale_warning == 'red' %} {% set warning_color= 'bg-danger' %} {% elif scale_warning == 'orange' %} {% set warning_color = 'bg-warning' %} {% elif scale_warning == 'green' %} {% set warning_color = 'bg-success' %} {% endif %} -
{{prob_inf | non_zero_percentage}} @@ -28,51 +47,73 @@ {% endblock warning_animation %} {% block report_summary %} - {% set report_message = "Taking into account the uncertainties tied to the model variables, in this scenario and assuming all occupants are exposed equally, 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 + "*." %} + {% set long_range_report_message = "Taking into account the uncertainties tied to the model variables, in this scenario and assuming all occupants are exposed equally, the probability of one exposed occupant getting infected is " + long_range_prob_inf | non_zero_percentage + " and the expected number of new cases is " + long_range_expected_new_cases | float_format + "*." %}
- {% if scale_warning == 'red' %} +
+ {% if long_range_scale_warning == 'red' %} - {% elif scale_warning == 'orange' %} + {% elif long_range_scale_warning == 'orange' %} - {% elif scale_warning == 'green' %} + {% elif long_range_scale_warning == 'green' %} {% endif %} - - {% if (prob_inf > 2) %} -
- {% if cern_level == "green-1" %} - - {% elif cern_level == "yellow-2" %} - - {% elif cern_level == "orange-3" %} - - {% elif cern_level == "red-4" %} - - {% else %} -

Note: The CERN COVID Level is not specified.

+ {% if form.short_range_option == "short_range_yes" %} +
+ {% set report_message = "Taking into account the uncertainties tied to the model variables, in this scenario and assuming all occupants are exposed equally, 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 scale_warning == 'red' %} + + {% elif scale_warning == 'orange' %} + + {% elif scale_warning == 'green' %} + + {% endif %} {% endif %} - {% endif %} -
+ {% if (prob_inf > 2) %} +
+ {% if cern_level == "green-1" %} + + {% elif cern_level == "yellow-2" %} + + {% elif cern_level == "orange-3" %} + + {% elif cern_level == "red-4" %} + + {% else %} +

Note: The CERN COVID Level is not specified.

+ {% endif %} + {% endif %} +
+
{% endblock report_summary %} -{% block report_summary_footnote %} +{% block report_summary_footnote %} +
{% if scale_warning == 'red' %} This exceeds the authorised risk threshold or number of expected new cases. The risk level must be reduced before this activity can be undertaken.