Merge branch 'develop/form_report-UI' into 'master'

Updates to form and report UI

See merge request cara/cara!33
This commit is contained in:
Philip James Elson 2020-11-06 10:11:41 +00:00
commit d9b880d056
5 changed files with 46 additions and 46 deletions

View file

@ -27,7 +27,6 @@ def calculate_report_data(model: models.Model):
"R0": r0,
}
def build_report(model: models.Model, form: FormData):
now = datetime.now()
time = now.strftime("%d/%m/%Y %H:%M:%S")

View file

@ -16,6 +16,10 @@ h1 {
padding-bottom: 15pt;
}
p.data_italic {
font-style: italic;
}
p.data_title {
font-weight: bold;
}

View file

@ -42,7 +42,7 @@ Beta v1.0.0 <span style="float:right; font-weight:bold">Please send feedback to
<div id="DIVmechanical_ventilation" style="display:none">
<input type="radio" id="air_type_supply" name="air_type" value="air_supply" onclick="require_fields(this)">
Air supply flow rate &nbsp;&nbsp; <input type="number" step=0.01 id="air_supply" name="air_supply" min="0"><br>
Air supply flow rate &nbsp;&nbsp; <input type="number" step=0.01 id="air_supply" name="air_supply" min="0" placeholder="(m³)"><br>
<input type="radio" id="air_type_changes" name="air_type" value="air_changes" onclick="require_fields(this)">
Air changes per hour &nbsp;&nbsp; <input type="number" step=0.01 id="air_changes" name="air_changes" min="0"><br>
</div>
@ -89,14 +89,14 @@ Beta v1.0.0 <span style="float:right; font-weight:bold">Please send feedback to
Finish: <input type="time" id="infected_finish" name="infected_finish" value="18:00" required><br>
<hr width="80%">
<span class="natural disabled">When is the event?</span><br>
<input type="radio" id="event_type_single" name="event_type" class="natural disabled" value="single_event" onclick="require_fields(this)" disabled></input>
<label for="event_type_single" class="natural disabled">Single event</label> &nbsp;&nbsp;
<label for="datepicker" class="natural disabled">Date: </label>
<input type="text" id="datepicker" class="natural disabled" name="single_event_date" disabled unrequired><br>
<input type="radio" id="event_type_recurrent" name="event_type" class="natural disabled" value="recurrent_event" onclick="require_fields(this)" disabled></input>
<label for="event_type_recurrent" class="natural disabled">Recurrent usage</label>
<select id="recurrent_event_month" name="recurrent_event_month" class="natural disabled" disabled>
When is the event?<br>
<input type="radio" id="event_type_single" name="event_type" value="single_event" onclick="require_fields(this)"></input>
<label for="event_type_single">Single event</label> &nbsp;&nbsp;
<label for="datepicker">Date: </label>
<input type="text" id="datepicker" name="single_event_date"><br>
<input type="radio" id="event_type_recurrent" name="event_type" value="recurrent_event" onclick="require_fields(this)"></input>
<label for="event_type_recurrent">Recurrent usage</label>
<select id="recurrent_event_month" name="recurrent_event_month">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>

View file

@ -21,7 +21,6 @@ function show_hide(show, hide, obj) {
show.style.display = "none";
obj.checked = false;
no_ventilation.checked = true;
unrequire_fields(obj);
} else if (show.style.display === "none") {
show.style.display = "block";
hide.style.display = "none";
@ -71,18 +70,6 @@ function require_fields(obj){
break;
} }
function unrequire_fields(obj){
switch(obj.id) {
case "mechanical":
require_mechanical_ventilation(false);
break;
case "natural":
require_natural_ventilation(false);
break;
default:
break;
} }
function require_room_volume(option) {
$("#room_volume").prop('required',option);
}
@ -106,21 +93,7 @@ function require_natural_ventilation(option) {
$("#interval").prop('required',option);
$("#event_type_single").prop('required',option);
$("#event_type_recurrent").prop('required',option);
document.getElementById("event_type_single").disabled = !option;
document.getElementById("event_type_recurrent").disabled = !option;
if (option) {
var elements = document.getElementsByClassName("natural disabled");
for(var i = elements.length - 1; i >= 0; --i)
elements[i].className = "natural enabled";
}
else {
$(".natural disabled").disabled = true
var elements = document.getElementsByClassName("natural enabled");
for(var i = elements.length - 1; i >= 0; --i)
elements[i].className = "natural disabled";
} }
}
function require_air_changes(option) {
$("#air_changes").prop('required',option);

View file

@ -43,6 +43,7 @@
<li><p class="data_subtext">Opening distance: {{ opening_distance }}</p></li>
<li><p class="data_subtext">Windows open: {{ windows_open }}</p></li>
</ul>
<p class="data_subtext data_italic">When using the natural ventilation option, air flows are calculated using averaged hourly temperatures for the Geneva region, based on historical data for the month selected.</p>
{% else %}
No </p></li>
{% endif %}
@ -52,9 +53,23 @@
<p class="data_title">Event data:</p>
<ul>
<li><p class="data_text">Number of attendees and infected people: {{ total_people }} in attendance, of whom {{ infected_people }} are infected.</p></li>
<li><p class="data_text">Activity type: {{ activity_type }}</p></li>
<ul>
<li><p class="data_text">Number of attendees and infected people: {{ total_people }} in attendance, of whom {{ infected_people }}
{% if infected_people == 1 %}
is
{% else %}
are
{% endif %}
infected.</p></li>
<li><p class="data_text">Activity type:
{% if activity_type == "office work" %}
Office work typical scenario with all persons seated, talking.
{% elif activity_type == "workshop" %}
Workshop = assembly workshop environment, all persons doing light exercise, talking.
{% elif activity_type == "training" %}
Training one person (the trainer) standing, talking, all others seated, talking quietly (whispering). It is assumed the trainer is the infected person, for the worst case scenario.
{% endif %}
</p></li>
<ul>
<li><p class="data_subtext">Start time: {{ activity_start }} &nbsp&nbsp End time: {{ activity_finish }}</p></li>
</ul>
<li><p class="data_text">Exposure time (presence of infected person):</p></li>
@ -72,11 +87,14 @@
<p class="data_title">Break data:</p>
<ul>
<li><p class="data_text">Lunch break: {{ lunch_option }}</li>
{% if lunch_option == "Yes" %}
<li><p class="data_text">Lunch break:
{% if lunch_option%}
Yes</li>
<ul>
<li> Start: {{ lunch_start }} &nbsp&nbsp End: {{ lunch_finish }}</p></li>
</ul>
{% else%}
No</li>
{% endif %}
<li><p class="data_text">Coffee breaks: {{ coffee_breaks }}
{% if coffee_breaks > 0 %}
@ -92,12 +110,18 @@
<p class="data_title">Mask wearing:</p>
<ul>
<li><p class="data_text">Masks worn at workstations? {{ mask_wearing }}</p></li>
<li><p class="data_text">Mask type: Type 1 (default, for now)</p></li>
<li><p class="data_text">Masks worn at workstations?
{% if mask_wearing == "removed" %}
No
{% else %}
Yes
{% endif %}
</p></li>
<li><p class="data_text">Mask type: Type 1</p></li>
</ul>
<p class="result_title">Results:</p>
<p class="data_text"> In this scenario, the estimated probability of one exposed occupant getting infected P(i) is {{ infection_probability }} % and the estimated basic reproduction rate (R0) rate is {{ reproduction_rate }}. This probability estimate is per simulated time period, i.e. if you have simulated a working day, which will be repeated n times per week, the cumulative probability of infection per person is n x P(i).<p>
<p class="data_text"> In this scenario, the estimated probability of one exposed occupant getting infected P(i) is {{ infection_probability }} % and the estimated basic reproduction rate (R0) is {{ reproduction_rate }}.<p>
<p class="data_title">Exposure graph:</p>
<br><br><br><br><br><br><br>