From 1cc73d4fbc9256ff5eabe1e53523eac7d64e3bc8 Mon Sep 17 00:00:00 2001 From: gaazzopa Date: Tue, 10 Nov 2020 16:59:05 +0100 Subject: [PATCH] Added HEPA amount option to form --- cara/apps/calculator/static/js/form.js | 10 ++++++++++ cara/apps/calculator/templates/calculator.form.html.j2 | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index 39625947..a15f403f 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -68,6 +68,12 @@ function require_fields(obj) { case "mask_off": require_mask(false); break; + case "hepa_yes": + require_hepa(true); + break; + case "hepa_no": + require_hepa(false); + break; default: break; } @@ -135,6 +141,10 @@ function require_lunch(option) { $("#lunch_finish").prop('required', option); } +function require_hepa(option) { + $("#hepa_amount").prop('required', option); +} + function setMaxInfectedPeople() { $("#infected_people").attr("max", $("#total_people").val()); } diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2 index b59b28c8..32e666fc 100644 --- a/cara/apps/calculator/templates/calculator.form.html.j2 +++ b/cara/apps/calculator/templates/calculator.form.html.j2 @@ -68,11 +68,11 @@ Beta v1.0.0 Please send feedback to HEPA filtration: - - - - + + + +
Face masks: