From 3c8ec9af68d593e7e5eef52aca3d001e22c8e0f7 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 9 Sep 2024 16:39:50 -0500 Subject: Enable samples uploads. --- uploader/templates/samples/list-samples.html | 5 +- uploader/templates/samples/upload-failure.html | 37 ++++++ uploader/templates/samples/upload-progress.html | 31 +++++ uploader/templates/samples/upload-samples.html | 155 ++++++++++++++++++++++++ uploader/templates/samples/upload-success.html | 36 ++++++ 5 files changed, 262 insertions(+), 2 deletions(-) create mode 100644 uploader/templates/samples/upload-failure.html create mode 100644 uploader/templates/samples/upload-progress.html create mode 100644 uploader/templates/samples/upload-samples.html create mode 100644 uploader/templates/samples/upload-success.html (limited to 'uploader/templates/samples') diff --git a/uploader/templates/samples/list-samples.html b/uploader/templates/samples/list-samples.html index a29dc1c..8f1bf16 100644 --- a/uploader/templates/samples/list-samples.html +++ b/uploader/templates/samples/list-samples.html @@ -97,7 +97,9 @@

- @@ -111,4 +113,3 @@ {%block sidebarcontents%} {{display_population_card(species, population)}} {%endblock%} - diff --git a/uploader/templates/samples/upload-failure.html b/uploader/templates/samples/upload-failure.html new file mode 100644 index 0000000..458ab55 --- /dev/null +++ b/uploader/templates/samples/upload-failure.html @@ -0,0 +1,37 @@ +{%extends "base.html"%} +{%from "cli-output.html" import cli_output%} +{%from "populations/macro-display-population-card.html" import display_population_card%} + +{%block title%}Samples Upload Failure{%endblock%} + +{%block contents%} +

+

{{job.job_name[0:50]}}…

+ +

There was a failure attempting to upload the samples.

+ +

Here is some information to help with debugging the issue. Provide this + information to the developer/maintainer.

+ +

Debugging Information

+ +
+ +
+

stdout

+{{cli_output(job, "stdout")}} +
+ +
+

stderr

+{{cli_output(job, "stderr")}} +
+{%endblock%} + +{%block sidebarcontents%} +{{display_population_card(species, population)}} +{%endblock%} diff --git a/uploader/templates/samples/upload-progress.html b/uploader/templates/samples/upload-progress.html new file mode 100644 index 0000000..677d457 --- /dev/null +++ b/uploader/templates/samples/upload-progress.html @@ -0,0 +1,31 @@ +{%extends "samples/base.html"%} +{%from "cli-output.html" import cli_output%} +{%from "populations/macro-display-population-card.html" import display_population_card%} + +{%block extrameta%} + +{%endblock%} + +{%block title%}Job Status{%endblock%} + +{%block contents%} +
+

{{job.job_name[0:50]}}…

+ +

+status: +{{job["status"]}} ({{job.get("message", "-")}})
+

+ +

saving to database...

+
+ +
+ {{cli_output(job, "stdout")}} +
+ +{%endblock%} + +{%block sidebarcontents%} +{{display_population_card(species, population)}} +{%endblock%} diff --git a/uploader/templates/samples/upload-samples.html b/uploader/templates/samples/upload-samples.html new file mode 100644 index 0000000..b101b2e --- /dev/null +++ b/uploader/templates/samples/upload-samples.html @@ -0,0 +1,155 @@ +{%extends "samples/base.html"%} +{%from "flash_messages.html" import flash_all_messages%} +{%from "populations/macro-select-population.html" import select_population_form%} +{%from "populations/macro-display-population-card.html" import display_population_card%} + +{%block title%}Samples — Upload Samples{%endblock%} + +{%block pagetitle%}Samples — Upload Samples{%endblock%} + +{%block lvl4_breadcrumbs%} +
+{%endblock%} + +{%block contents%} +{{flash_all_messages()}} + +
+

You can now upload a character-separated value (CSV) file that contains + details about your samples. The CSV file should have the following fields: +

+
Name
+
The primary name/identifier for the sample/individual.
+ +
Name2
+
A secondary name for the sample. This can simply be the same as + Name above. This field MUST contain a + value.
+ +
Symbol
+
A symbol for the sample. This can be a strain name, e.g. 'BXD60' for + species that have strains. This field can be left empty for species like + Humans that do not have strains..
+ +
Alias
+
An alias for the sample. Can be an empty field, or take on the same + value as that of the Symbol.
+
+

+
+ +
+
+ upload samples + + + + +
+ + +
+ +
+ + + + + If you select 'Other' for the field separator value, + enter the character that separates the fields in your CSV file in the form + field below. + +
+ +
+ + + + Select this if the first line in your file contains headings for the + columns. + +
+ +
+ + + + If there is a character delimiting the string texts within particular + fields in your CSV, provide the character here. This can be left blank if + no such delimiters exist in your file. + +
+ + +
+
+ +
+

Preview File Content

+ + + + + + + + + + + + + + + + + + +
preview content
NameName2SymbolAlias
+ Please make some selections in the form above to preview the data.
+
+{%endblock%} + +{%block sidebarcontents%} +{{display_population_card(species, population)}} +{%endblock%} + +{%block javascript%} + +{%endblock%} diff --git a/uploader/templates/samples/upload-success.html b/uploader/templates/samples/upload-success.html new file mode 100644 index 0000000..881d466 --- /dev/null +++ b/uploader/templates/samples/upload-success.html @@ -0,0 +1,36 @@ +{%extends "samples/base.html"%} +{%from "cli-output.html" import cli_output%} +{%from "populations/macro-display-population-card.html" import display_population_card%} + +{%block title%}Job Status{%endblock%} + +{%block contents%} + +
+

{{job.job_name[0:50]}}…

+ +

+ status: + {{job["status"]}} ({{job.get("message", "-")}})
+

+ +

Successfully uploaded the samples.

+

+ + View samples + +

+
+ +
+ {{cli_output(job, "stdout")}} +
+ +{%endblock%} + +{%block sidebarcontents%} +{{display_population_card(species, population)}} +{%endblock%} -- cgit v1.2.3