diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py index e8aa9580..45dea024 100644 --- a/cara/apps/calculator/report_generator.py +++ b/cara/apps/calculator/report_generator.py @@ -279,22 +279,22 @@ def comparison_report(scenarios: typing.Dict[str, models.ExposureModel]): def get_level_warning(scale_warning, incidence_rate, onsite_access, threshold) -> dict: if scale_warning == 'Green - 1': scale_level = { - 'level': 1, + 'display_png': 'cara/apps/calculator/static/images/warning_level3.jpeg', 'display_text': f'Note: the current CERN COVID Scale is Green - 1, which means the incidence rate in the local community is {incidence_rate}. Align your risk assessment with the guidance and instructions provided by the HSE Unit.' } elif scale_warning == 'Yellow - 2': scale_level = { - 'level': 2, + 'display_png': 'cara/apps/calculator/static/images/warning_level3.jpeg', 'display_text': f'Note: the current CERN COVID Scale is Yellow - 2, which means the incidence rate in the local community is {incidence_rate}. There is a reduced chance that asymptomatic or pre-symptomatic infected individuals circulate within the CERN site which, during this stage, corresponds to an average daily on-site access {onsite_access}. See with your supervisor if this scenario is acceptable.' } elif scale_warning == 'Orange - 3': scale_level = { - 'level': 3, + 'display_png': 'cara/apps/calculator/static/images/warning_level3.jpeg', 'display_text': f'Warning: the current CERN COVID Scale is Orange - 3, which means the incidence rate in the local community is {incidence_rate}. There is a slight chance that asymptomatic or pre-symptomatic infected individuals circulate within the CERN site which, during this stage, corresponds to an average daily on-site access {onsite_access}. See with your supervisor if any additional measures can be applied (ALARA).' } elif scale_warning == 'Red - 4': scale_level = { - 'level': 4, + 'display_png': '/static/images/warning_level3.jpeg', 'display_text': f'Warning: the current CERN COVID Scale is Red - 4, which means the incidence rate in the local community is {incidence_rate}. There is a strong chance that asymptomatic or pre-symptomatic infected individuals circulate within the CERN site which, during this stage, corresponds to an average daily on-site access {onsite_access}. Please reduce the value below the threshold of {threshold}.' } return scale_level @@ -337,7 +337,7 @@ class ReportGenerator: onsite_access = 'lower than 4000' threshold = '5%' ''' - scale_warning = get_level_warning(scale_warning = 'Green - 1', incidence_rate = 'higher or equal to 100 new cases per 100 000 inhabitants', onsite_access = 'lower than 4000', threshold = '') + scale_warning = get_level_warning(scale_warning = 'Red - 4', incidence_rate = 'higher or equal to 100 new cases per 100 000 inhabitants', onsite_access = 'lower than 4000', threshold = '') context = { 'model': model, diff --git a/cara/apps/calculator/static/css/report.css b/cara/apps/calculator/static/css/report.css index 4a67fc55..094374fa 100644 --- a/cara/apps/calculator/static/css/report.css +++ b/cara/apps/calculator/static/css/report.css @@ -68,3 +68,9 @@ p.notes { background-color: #90EE90; text-decoration: none; } + +/* Flexbox layouts */ +.flex_space_between { + display: flex; + justify-content: space-between; +} diff --git a/cara/apps/calculator/static/images/warning_level3.jpeg b/cara/apps/calculator/static/images/warning_level3.jpeg new file mode 100644 index 00000000..3c7c6bf2 Binary files /dev/null and b/cara/apps/calculator/static/images/warning_level3.jpeg differ diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2 index 79e8d649..54f4b222 100644 --- a/cara/apps/calculator/templates/base/calculator.report.html.j2 +++ b/cara/apps/calculator/templates/base/calculator.report.html.j2 @@ -214,8 +214,12 @@ 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) %} -