From 9cf25e707fbd49d357cf295ad62f83d805c59c2c Mon Sep 17 00:00:00 2001 From: Naeem Model Date: Sun, 26 May 2024 02:38:19 +0000 Subject: Update Shiny app - Refactor data upload and sample data - Create custom data upload button - Create script.js - Change Shiny notification colour - Bug fix: ensure the case counts in bulk data that have only one row are treated as a data frame, by wrapping them in 'data.frame' before passing to 'apply' --- inst/app/templates/content/data/enter-data.html | 6 +++- .../content/data/enter-data/bulk-entry.html | 33 ++++++++++++++-------- .../content/data/enter-data/load-samples.html | 17 +++++++++++ 3 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 inst/app/templates/content/data/enter-data/load-samples.html (limited to 'inst/app/templates/content') diff --git a/inst/app/templates/content/data/enter-data.html b/inst/app/templates/content/data/enter-data.html index 621c785..f4d5e75 100644 --- a/inst/app/templates/content/data/enter-data.html +++ b/inst/app/templates/content/data/enter-data.html @@ -8,6 +8,10 @@
-
+ {{ htmlTemplate("templates/content/data/enter-data/bulk-entry.html") }}
+
+
+ {{ htmlTemplate("templates/content/data/enter-data/load-samples.html") }} +
diff --git a/inst/app/templates/content/data/enter-data/bulk-entry.html b/inst/app/templates/content/data/enter-data/bulk-entry.html index 82a3ccf..30fab06 100644 --- a/inst/app/templates/content/data/enter-data/bulk-entry.html +++ b/inst/app/templates/content/data/enter-data/bulk-entry.html @@ -1,13 +1,11 @@

Bulk entry

+ data-bs-toggle="collapse" data-bs-target="#bulk-help">Show required format
-

Enter one or more rows in the following format:

+

Manually enter rows or upload a CSV file in the following format:

Dataset name,Time units,Case counts

@@ -27,11 +25,24 @@
-
- - +
+ + +
+ +
+ +
+ + + + +
+ +
- - + diff --git a/inst/app/templates/content/data/enter-data/load-samples.html b/inst/app/templates/content/data/enter-data/load-samples.html new file mode 100644 index 0000000..a42a8c8 --- /dev/null +++ b/inst/app/templates/content/data/enter-data/load-samples.html @@ -0,0 +1,17 @@ +

Load samples

+{{ + checkboxInput(inputId = "covid_canada", label = "COVID-19 Canada, 2020/03/03 - 2020/03/31 (Weekly)", + value = FALSE, width = "100%" + ) +}} +{{ + checkboxInput(inputId = "covid_ontario", label = "COVID-19 Ontario, 2020/03/03 - 2020/03/31 (Weekly)", + value = FALSE, width = "100%" + ) +}} +
+ +
+ -- cgit v1.2.3