From 9ad8972da19d6105df8ea62a744011f5fce520d9 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 1 Nov 2021 10:11:23 +0100 Subject: [PATCH 1/6] Changed h1 to span to prevent autoresize on android --- .../calculator/templates/calculator.form.html.j2 | 2 +- cara/apps/static/css/style.css | 12 +++--------- cara/apps/templates/index.html.j2 | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2 index 1aee7979..66207acf 100644 --- a/cara/apps/calculator/templates/calculator.form.html.j2 +++ b/cara/apps/calculator/templates/calculator.form.html.j2 @@ -23,7 +23,7 @@
-

CARA - COVID Airborne Risk Assessment Calculator

+

CARA - COVID Airborne Risk Assessment Calculator

diff --git a/cara/apps/static/css/style.css b/cara/apps/static/css/style.css index f92b0e51..4a2cb824 100644 --- a/cara/apps/static/css/style.css +++ b/cara/apps/static/css/style.css @@ -113,11 +113,6 @@ body { font-size: 2.75vh; } -.head-center { - text-align: center; - font-size: 3vh; -} - .center { position: relative; display: flex; @@ -211,10 +206,6 @@ footer img { height: 6em; } - .head-center { - font-size: 2.5rem; - } - .header-text { font-size: 2rem; } @@ -278,6 +269,9 @@ footer img { float:left; font-size:.75rem; } + .h1-text { + font-size: 1.5rem; + } } /* Devices under 768px (md) */ diff --git a/cara/apps/templates/index.html.j2 b/cara/apps/templates/index.html.j2 index 28454cfc..3fdfcb24 100644 --- a/cara/apps/templates/index.html.j2 +++ b/cara/apps/templates/index.html.j2 @@ -6,7 +6,7 @@
-

CARA - COVID Airborne Risk Assessment

+

CARA - COVID Airborne Risk Assessment

From 6cd36872a0e9a002ec3297cb34339a89fcd881e5 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Tue, 2 Nov 2021 09:23:54 +0100 Subject: [PATCH 2/6] Changed class for the paragraph titles --- cara/apps/calculator/static/css/report.css | 2 +- cara/apps/static/css/style.css | 6 +++--- cara/apps/templates/index.html.j2 | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cara/apps/calculator/static/css/report.css b/cara/apps/calculator/static/css/report.css index 52aeb1ea..b8f6ae17 100644 --- a/cara/apps/calculator/static/css/report.css +++ b/cara/apps/calculator/static/css/report.css @@ -226,7 +226,7 @@ p.notes { .split>* { flex-basis: 100%; } - .header-text { + .paragraph-title { text-align: left; } .split>*+* { diff --git a/cara/apps/static/css/style.css b/cara/apps/static/css/style.css index 4a2cb824..5db3e6ac 100644 --- a/cara/apps/static/css/style.css +++ b/cara/apps/static/css/style.css @@ -108,7 +108,7 @@ body { padding: 2rem 0; } -.header-text { +.paragraph-title { text-align: center; font-size: 2.75vh; } @@ -189,7 +189,7 @@ footer img { flex-basis: 100%; } - .header-text { + .paragraph-title { text-align: left; } @@ -206,7 +206,7 @@ footer img { height: 6em; } - .header-text { + .paragraph-title { font-size: 2rem; } diff --git a/cara/apps/templates/index.html.j2 b/cara/apps/templates/index.html.j2 index 3fdfcb24..aee3046e 100644 --- a/cara/apps/templates/index.html.j2 +++ b/cara/apps/templates/index.html.j2 @@ -13,7 +13,7 @@
-

Introduction


+

Introduction


CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. @@ -31,7 +31,7 @@

-

CARA @ CERN


+

CARA @ CERN


CARA has been developed by CERN with the intention of allowing members of personnel with roles related to supervision, health & safety or space management to simulate the concerned workplaces on CERN sites. @@ -40,7 +40,7 @@


-

Acknowledgements


+

Acknowledgements


We wish to thank CERN’s HSE Unit, Beams Department, Experimental Physics Department, Information Technology Department, Industry, Procurement and Knowledge Transfer Department and International Relations Sector for their support to the study. Thanks to Doris Forkel-Wirth, Benoit Delille, Walid Fadel, Olga Beltramello, Letizia Di Giulio, Evelyne Dho, Wayne Salter, Benoit Salvant and colleagues from the COVID working group for providing expert advice and extensively testing the model. From f6e33d10bee4d1c55012bea9bdcced007e8e5a93 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Tue, 2 Nov 2021 10:03:53 +0100 Subject: [PATCH 3/6] Prevent to zoom in on mobile app --- cara/apps/calculator/templates/base/calculator.report.html.j2 | 2 +- cara/apps/templates/layout.html.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2 index 2e2930ac..705ee449 100644 --- a/cara/apps/calculator/templates/base/calculator.report.html.j2 +++ b/cara/apps/calculator/templates/base/calculator.report.html.j2 @@ -2,7 +2,7 @@ - + Report | CARA (COVID Airborne Risk Assessment) diff --git a/cara/apps/templates/layout.html.j2 b/cara/apps/templates/layout.html.j2 index 131c5497..555e81b3 100644 --- a/cara/apps/templates/layout.html.j2 +++ b/cara/apps/templates/layout.html.j2 @@ -3,7 +3,7 @@ - + From 85a78de071e04933108382f8452b4f48c651ac4a Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 2 Nov 2021 11:27:54 +0100 Subject: [PATCH 4/6] Prevent spinner to be displayed when clicking back button --- cara/apps/calculator/static/js/form.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index e83c8ae1..956168cf 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -369,7 +369,7 @@ function validate_form(form) { $("#generate_report").prop("disabled", true); //Add spinner to button $("#generate_report").html( - `<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Loading...` + `<span id="loading_spinner" class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Loading...` ); } @@ -487,12 +487,17 @@ function parseTimeToMins(cTime) { return parseInt(time[1]*60) + parseInt(time[2]); } +// Prevent spinner when clicking on back button +window.onbeforeunload = function(){ + $('loading_spinner').remove(); + $("#generate_report").prop("disabled", false).html(`Generate report`); +}; + /* -------On Load------- */ $(document).ready(function () { var url = new URL(decodeURIComponent(window.location.href)); //Pre-fill form with known values url.searchParams.forEach((value, name) => { - //If element exists if(document.getElementsByName(name).length > 0) { var elemObj = document.getElementsByName(name)[0]; From a09482ad32cd3aad598588b984357eac95b4fa3d Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 2 Nov 2021 12:08:04 +0100 Subject: [PATCH 5/6] Bugs on about page for mobile screen sizes --- cara/apps/templates/about.html.j2 | 16 ++++++++-------- cara/apps/templates/common_text.md.j2 | 4 ++-- cara/apps/templates/layout.html.j2 | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cara/apps/templates/about.html.j2 b/cara/apps/templates/about.html.j2 index 2f1ad194..e0b517f9 100644 --- a/cara/apps/templates/about.html.j2 +++ b/cara/apps/templates/about.html.j2 @@ -2,16 +2,16 @@ {% block main %} -<div class="container container--padding"> +<div class="container container--padding" style="word-wrap:break-word";> -<h1>Airborne Transmission of SARS-CoV-2</h1><br> +<h1 class="paragraph-title">Airborne Transmission of SARS-CoV-2</h1><br> Currently, the existing public health measures point to the importance of proper building and environmental engineering control measures, such as proper Indoor Air Quality (IAQ). This pandemic clearly raised increased awareness on airborne transmission of respiratory viruses in indoor settings. Out of the main modes of viral transmission, the airborne route of SARS-CoV-2 seems to have a significant importance to the spread of COVID-19 infections world-wide, hence proper guidance to building engineers or facility managers, on how to prevent on-site transmission, is essential.<br> For information on the Airborne Transmission of SARS-CoV-2, feel free to check out the HSE Seminar: <a href=https://cds.cern.ch/record/2743403>https://cds.cern.ch/record/2743403</a>.<br> Slides available in <a href=https://indico.cern.ch/event/968258>https://indico.cern.ch/event/968258/</a>. <br><br> -<h1>What is CARA?</h1><br> +<h1 class="paragraph-title">What is CARA?</h1><br> CARA stands for COVID Airborne Risk Assessment and was developed in the spring of 2020 to better understand and quantify the risk of long-range airborne spread of SARS-CoV-2 virus in workplaces. CARA comes with different applications that allow more or less flexibility in the input parameters: <ul> <li><a href='{{ calculator_prefix }}'>CARA calculator app</a></li> @@ -32,7 +32,7 @@ The methodology of the model is divided into three parts: </ol> Parts #1 and #3 are mainly based on methods published in scientific papers (see <a href="#references_block">References</a>), and cover the medical aspects, which is not the core competencies of the authors. The ‘heart and soul’ of CARA lies within the Part #2 and the concentration modelling, which is based on a mass-balance differential equation solved for a constant emission rate and time-dependent exchange rate (e.g. natural ventilation flow rate). Other aspects, e.g., the biological decay of the virus in the air, gravitational settlement of the aerosols, mechanical supply of fresh air, effect of HEPA filtration, among others, are also included.<br> <br> -<h1>What is the aim of CARA?</h1><br> +<h1 class="paragraph-title">What is the aim of CARA?</h1><br> Although the user is able to calculate the infection probability of a stand-alone event with a pre-defined set of protection measures, the main utility of CARA is to compare the relative impact of different measures and/or combination of measure. For example: <ul> <li>Compare keeping a window slightly open vs one or two windows open entirely</li> @@ -42,16 +42,16 @@ Although the user is able to calculate the infection probability of a stand-alon <li>Etc…</li> </ul> -<h1>Main Developers:</h1><br> +<h1 class="paragraph-title">Main Developers:</h1><br> {{ text_blocks['Main Developers'] }} <br> -<h2>Code Contributors:</h2><br> +<h2 class="paragraph-title">Code Contributors:</h2><br> {{ text_blocks['Code Contributors'] }} <br> -<h1>Acknowledgements:</h1><br> +<h1 class="paragraph-title">Acknowledgements:</h1><br> {{ text_blocks['Acknowledgements'] }} <br> -<a id="references_block" style="color:#2f4858"><h1>References:</h1></a><br> +<a id="references_block" style="color:#2f4858"><h1 class="paragraph-title">References:</h1></a><br> {{ text_blocks['References'] }} <div class="text-component text-component-page clearfix"></div> diff --git a/cara/apps/templates/common_text.md.j2 b/cara/apps/templates/common_text.md.j2 index 6e5c361e..228b86f3 100644 --- a/cara/apps/templates/common_text.md.j2 +++ b/cara/apps/templates/common_text.md.j2 @@ -1,6 +1,6 @@ ## Main Developers -<h4>Andre Henriques<sup>1</sup>, Luis Aleixo<sup>1</sup>, Marco Andreini<sup>1</sup>, Gabriella Azzopardi<sup>2</sup>, James Devine<sup>3</sup>, Philip Elson<sup>4</sup>, Nicolas Mounet<sup>2</sup>, Markus Kongstein Rognlien<sup>2,6</sup>, Nicola Tarocco<sup>5</sup></h4><br> +<h4 class="paragraph-title">Andre Henriques<sup>1</sup>, Luis Aleixo<sup>1</sup>, Marco Andreini<sup>1</sup>, Gabriella Azzopardi<sup>2</sup>, James Devine<sup>3</sup>, Philip Elson<sup>4</sup>, Nicolas Mounet<sup>2</sup>, Markus Kongstein Rognlien<sup>2,6</sup>, Nicola Tarocco<sup>5</sup></h4><br> <sup>1</sup>HSE Unit, Occupational Health & Safety Group, CERN<br> <sup>2</sup>Beams Department, Accelerators and Beam Physics Group, CERN<br> @@ -11,7 +11,7 @@ ## Code Contributors -<h4>Anna Efimova<sup>1</sup>, Anel Massalimova<sup>1</sup>, Cole Austin Coughlin<sup>1</sup></h4> +<h4 class="paragraph-title">Anna Efimova<sup>1</sup>, Anel Massalimova<sup>1</sup>, Cole Austin Coughlin<sup>1</sup></h4> <sup>1</sup>Summer Students, CERN<br> diff --git a/cara/apps/templates/layout.html.j2 b/cara/apps/templates/layout.html.j2 index 555e81b3..0183a7fd 100644 --- a/cara/apps/templates/layout.html.j2 +++ b/cara/apps/templates/layout.html.j2 @@ -40,7 +40,7 @@ <li class="nav-link"><a href="{{ calculator_prefix }}" class="{{ "nav-link active" if "calculator/" == active_page else "nav-link" }}">COVID CALCULATOR</a></li> <li class="nav-link"><a href="/expert-app" class="{{ "nav-link active" if "/expert-app" == active_page else "nav-link" }}">EXPERT APP (BETA)</a></li> <li class="nav-link"><a href="https://hse.cern/covid-19-information" class="nav-link">COVID INFORMATION</a></li> - <li class="nav-link"><a href="/about" class="{{ "active" if "about" == active_page else "nav-link" }}">ABOUT</a></li> + <li class="nav-link"><a href="/about" class="{{ "nav-link active" if "about" == active_page else "nav-link" }}">ABOUT</a></li> </ul> </div> </div> From 1d943a5dd02c104d2916f66976463f7655a09d01 Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 2 Nov 2021 14:48:18 +0100 Subject: [PATCH 6/6] iOS back button --- cara/apps/calculator/static/js/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index 956168cf..88cf09e3 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -488,7 +488,7 @@ function parseTimeToMins(cTime) { } // Prevent spinner when clicking on back button -window.onbeforeunload = function(){ +window.onpagehide = function(){ $('loading_spinner').remove(); $("#generate_report").prop("disabled", false).html(`Generate report`); };