From 7867d8a52d2efba81803691167c469a13a20920b Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 25 Aug 2022 16:36:14 +0100 Subject: [PATCH] updated column names on exported CSV --- cara/apps/calculator/static/js/report.js | 16 +++++++------- .../templates/base/calculator.report.html.j2 | 22 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index d780c992..26e41cc3 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -898,7 +898,7 @@ function export_csv() { if (e.id == "Alternative Scenarios") { Object.entries(alternative_scenarios).map((scenario) => { if (scenario[0] != 'Current scenario') { - checked_names.push(`Alternative scenario concentrations - ${scenario[0]} (virions m⁻³)`); + checked_names.push(`Alternative scenario concentration - ${scenario[0]} \u2028(virions m⁻³)`); has_alternative_scenario = true; }; }); @@ -907,21 +907,21 @@ function export_csv() { var has_rename = document.getElementById(`${e.id}__rename`).value; var column_name = has_rename != '' ? has_rename : e.id; if (short_range_expirations.length > 0) { - checked_names.push(`Long-Range ${column_name} (infectious virus)`); + checked_names.push(`Long-Range ${column_name} \u2028(infectious virus)`); checked_items.push('Long-Range Dose'); // When we have short range interactions, we want the column for the cumulative dose to have the "Total" word before the column name - checked_names.push(`Total ${column_name} (infectious virus)`); + checked_names.push(`Total ${column_name} \u2028(infectious virus)`); } else { - checked_names.push(`${column_name} (infectious virus)`); + checked_names.push(`${column_name} \u2028(infectious virus)`); } checked_items.push(e.id); } else { var has_rename = document.getElementById(`${e.id}__rename`).value; var column_name = has_rename != '' ? has_rename : e.id; - if (e.id == "Times") checked_names.push(`${column_name} (h)`); - else if (e.id == "Concentrations") checked_names.push(`${column_name} (virions m⁻³)`); + if (e.id == "Time") checked_names.push(`${column_name} \u2028(h)`); + else if (e.id == "Concentration") checked_names.push(`${column_name} \u2028(virions m⁻³)`); checked_items.push(e.id); } } @@ -931,8 +931,8 @@ function export_csv() { // Add data for each column. times.forEach((e, i) => { let this_row = []; - checked_items.includes("Times") && this_row.push(times[i].toFixed(2)); - checked_items.includes("Concentrations") && this_row.push(concentrations[i]); + checked_items.includes("Time") && this_row.push(times[i].toFixed(2)); + checked_items.includes("Concentration") && this_row.push(concentrations[i]); checked_items.includes("Cumulative Dose") && this_row.push(cumulative_doses[i]); checked_items.includes("Long-Range Dose") && this_row.push(long_range_cumulative_doses[i]); if (has_alternative_scenario) { diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index 715c685e..7f270e86 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -239,11 +239,11 @@