diff --git a/cara/apps/calculator/static/css/form.css b/cara/apps/calculator/static/css/form.css index bbc7f767..24781792 100644 --- a/cara/apps/calculator/static/css/form.css +++ b/cara/apps/calculator/static/css/form.css @@ -1,9 +1,5 @@ .disabled { - color: gray; -} - -.disabled { - color: black; + background-color: silver; } .red_border { diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index d8fc1bcf..8c9a9256 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -84,11 +84,14 @@ function unrequire_fields(obj) { function require_room_volume(option) { require_input_field("#room_volume", option); + disable_input_field("#room_volume", option); } function require_room_dimensions(option) { require_input_field("#floor_area", option); require_input_field("#ceiling_height", option); + disable_input_field("#floor_area", option); + disable_input_field("#ceiling_height", option); } function require_mechanical_ventilation(option) { @@ -110,24 +113,22 @@ function require_natural_ventilation(option) { function require_air_changes(option) { require_input_field("#air_changes", option); + disable_input_field("#air_changes", option); } function require_air_supply(option) { require_input_field("#air_supply", option); + disable_input_field("#air_supply", option); } function require_single_event(option) { require_input_field("#single_event_date", option); -} - -function require_input_field(id, option) { - $(id).prop('required', option); - if (!option) - removeInvalid(id); + disable_input_field("#single_event_date", option); } function require_recurrent_event(option) { $("#recurrent_event_month").prop('required', option); + disable_input_field("#recurrent_event_month", option); } function require_lunch(option) { @@ -156,6 +157,20 @@ function require_mask(option) { function require_hepa(option) { require_input_field("#hepa_amount", option); + disable_input_field("#hepa_amount", option); +} + +function require_input_field(id, option) { + $(id).prop('required', option); + if (!option) + removeInvalid(id); +} + +function disable_input_field(id, option) { + if (option) + $(id).removeClass("disabled"); + else + $(id).addClass("disabled"); } function setMaxInfectedPeople() { @@ -382,8 +397,11 @@ $(document).ready(function () { // Call the function now to handle forward/back button presses in the browser. on_ventilation_type_change(); - //Same for lunch option + //Same for other options require_fields($("input[name='lunch_option']:checked")); + require_fields($("input[name='volume_type']:checked")); + require_fields($("input[name='mechanical_ventilation_type']:checked")); + require_fields($("input[name='hepa_option']:checked")); // Setup the maximum number of people at page load (to handle back/forward), // and update it when total people is changed. diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2 index 3a4705dc..c06cbf59 100644 --- a/cara/apps/calculator/templates/calculator.form.html.j2 +++ b/cara/apps/calculator/templates/calculator.form.html.j2 @@ -34,8 +34,8 @@
- Simulation name:
- Room number:
+ Simulation name:
+ Room number:

Room data:
@@ -43,12 +43,12 @@

   -
+
   -
+
         -
+

@@ -57,39 +57,39 @@ ?

Ventilation type: - +    - +    - +
HEPA filtration: - +    - +    - +
Face masks: @@ -97,14 +97,14 @@ ?
Are masks worn when occupants are at workstations? - +    - +
Type of masks used: - +    - +

@@ -116,12 +116,12 @@
?

- Total number of occupants:
- Number of infected people:
+ Total number of occupants:
+ Number of infected people:

- Activity type: @@ -130,11 +130,11 @@
- Start:    - Finish:
+ Start:    + Finish:
Infected person(s) presence:
- Start:    - Finish:
+ Start:    + Finish:

When is the event? @@ -144,10 +144,10 @@    -
+
- @@ -168,26 +168,26 @@ Lunch break:   - +    - +
- Start:    - Finish:
+ Start:    + Finish:
Coffee Breaks:   - +    - +    - +
- Duration (minutes): @@ -233,7 +233,7 @@ Refer to COVID Calculator user-guide for more detailed explanations on how to use this tool.
-



+