From 2def169cdb16d4d91b67e2fa75059e6bd86a12ab Mon Sep 17 00:00:00 2001
From: Luis Aleixo
Date: Wed, 13 Oct 2021 17:07:20 +0200
Subject: [PATCH] Event data tab with start and end time on each row
---
cara/apps/calculator/static/js/report.js | 12 ++++++------
.../templates/base/calculator.report.html.j2 | 12 ++++++++----
.../calculator/templates/calculator.form.html.j2 | 4 ++--
3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js
index a22cfff8..43db5d1e 100644
--- a/cara/apps/calculator/static/js/report.js
+++ b/cara/apps/calculator/static/js/report.js
@@ -139,7 +139,7 @@ function draw_concentration_plot(svg_id, times, concentrations, exposed_presence
graph_width = div_width;
graph_height = div_height
if (div_width >= 900) { // For screens with width > 900px legend can be on the graph's right side.
- var margins = { top: 30, right: 20, bottom: 50, left: 50 };
+ var margins = { top: 30, right: 20, bottom: 50, left: 60 };
div_width = 900;
graph_width = div_width * (2/3);
const svg_margins = {'margin-left': '0rem', 'margin-top': '0rem'};
@@ -196,7 +196,7 @@ function draw_concentration_plot(svg_id, times, concentrations, exposed_presence
yAxisEl.attr('transform', 'translate(' + margins.left + ',0)').call(yAxis);
yAxisLabelEl.attr('x', (graph_height * 0.9 + margins.bottom) / 2)
- .attr('y', (graph_height + margins.left) * 0.90)
+ .attr('y', (graph_height + margins.left) * 0.9)
.attr('transform', 'rotate(-90, 0,' + graph_height + ')');
// Legend on right side.
@@ -224,7 +224,7 @@ function draw_concentration_plot(svg_id, times, concentrations, exposed_presence
legendAreaText.attr('x', 2 * size)
.attr('y', graph_height + 1.7 * size);
legendBBox.attr('x', 1)
- .attr('y', graph_height * 1.01);
+ .attr('y', graph_height);
}
// ToolBox.
@@ -412,7 +412,7 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_
graph_width = div_width;
graph_height = div_height
if (div_width >= 900) { // For screens with width > 900px legend can be on the graph's right side.
- var margins = { top: 30, right: 20, bottom: 50, left: 50 };
+ var margins = { top: 30, right: 20, bottom: 50, left: 60 };
div_width = 900;
graph_width = div_width * (2/3);
const svg_margins = {'margin-left': '0rem'};
@@ -458,7 +458,7 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_
else {
label_icons[scenario_name].attr('x', margins.left * 0.3)
.attr('y', graph_height + size);
- label_text[scenario_name].attr('x', margins.left * 1.3)
+ label_text[scenario_name].attr('x', margins.left * 1.4)
.attr('y', graph_height + size);
}
@@ -491,7 +491,7 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_
// Legend on the bottom.
else {
legendBBox.attr('x', 1)
- .attr('y', graph_height * 1.01)
+ .attr('y', graph_height * 1.02)
}
// ToolBox.
diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2
index 3c9252ad..06c157dc 100644
--- a/cara/apps/calculator/templates/base/calculator.report.html.j2
+++ b/cara/apps/calculator/templates/base/calculator.report.html.j2
@@ -304,11 +304,13 @@
Exposed occupant(s) activity time:
- Start time: {{ form.exposed_start | minutes_to_time }}    End time: {{ form.exposed_finish | minutes_to_time }}
+ Start time: {{ form.exposed_start | minutes_to_time }}
+ End time: {{ form.exposed_finish | minutes_to_time }}
Infected occupant(s) activity time:
- Start time: {{ form.infected_start | minutes_to_time }}    End time: {{ form.infected_finish | minutes_to_time }}
+ Start time: {{ form.infected_start | minutes_to_time }}
+ End time: {{ form.infected_finish | minutes_to_time }}
Event for the month of {{ form.event_month }}
@@ -326,7 +328,8 @@
{% if form.exposed_lunch_option%}
Yes
- Start time: {{ form.exposed_lunch_start | minutes_to_time }}    End time: {{ form.exposed_lunch_finish | minutes_to_time }}
+ Start time: {{ form.exposed_lunch_start | minutes_to_time }}
+ End time: {{ form.exposed_lunch_finish | minutes_to_time }}
{% else%}
No
@@ -351,7 +354,8 @@
{% if form.infected_lunch_option%}
Yes
- Start time: {{ form.infected_lunch_start | minutes_to_time }}    End time: {{ form.infected_lunch_finish | minutes_to_time }}
+ Start time: {{ form.infected_lunch_start | minutes_to_time }}
+ End time: {{ form.infected_lunch_finish | minutes_to_time }}
{% else%}
No
diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2
index c239e87d..70d4297f 100644
--- a/cara/apps/calculator/templates/calculator.form.html.j2
+++ b/cara/apps/calculator/templates/calculator.form.html.j2
@@ -518,9 +518,9 @@ v{{ calculator_version }}
for more detailed explanations on how to use this tool.
-