From d2698e74c6f5f2977568005232f1b76142ee217f Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Sat, 11 Apr 2020 02:32:02 +0300 Subject: Add custom css styling - Update font - Make layout look more aesthetic --- bh20simplewebuploader/templates/form.html | 259 +++++++++++++++++++++--------- 1 file changed, 187 insertions(+), 72 deletions(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html index 2934a7c..6720ec7 100644 --- a/bh20simplewebuploader/templates/form.html +++ b/bh20simplewebuploader/templates/form.html @@ -1,95 +1,210 @@ + + + Simple Web Uploader for Public SARS-CoV-2 Sequence Resource

Simple Web Uploader for Public SARS-CoV-2 Sequence Resource


-

- This tool can be used to upload sequenced genomes of SARS-CoV-2 samples to the Public SARS-CoV-2 Sequence Resource. Your uploaded sequence will automatically be processed and incorporated into the public pangenome. -

-
-
- -
- -
- - -
- - -
- - -
- -
-
- +
+ +

+ This tool can be used to upload sequenced genomes of SARS-CoV-2 samples to the Public SARS-CoV-2 Sequence Resource. Your uploaded sequence will automatically be processed and incorporated into the public pangenome. +

+
+ +
+ +
+
+ + -
- -
-
- {% for record in fields %} + +
+
+ +
+ +
+
+
+ +
+
+ {{ record }} + {% for record in fields %} + {% if 'heading' in record %} -

{{ record['heading'] }}

+ {% if loop.index > 1 %} +
+ {% endif %} +
+

{{ record['heading'] }}

{% else %} - -
- -
+ + {% endif %} + {% if loop.index == loop.length %} +
+ {% endif %} {% endfor %}
-
- - - +
+ + + + +
- Source · Made for COVID-19-BH20 + Source · Made for COVID-19-BH20 + -- cgit v1.2.3 From 04912c58cdab27962429be56971afde189d702c4 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Fri, 10 Apr 2020 16:43:05 -0700 Subject: Clarify supported formats and make web UI take FASTQ --- README.md | 4 ++-- bh20simplewebuploader/main.py | 6 ++++-- bh20simplewebuploader/templates/form.html | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'bh20simplewebuploader') diff --git a/README.md b/README.md index 2a1657d..db4fe52 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,10 @@ For running/developing the uploader with GNU Guix see [INSTALL.md](./doc/INSTALL # Usage -Run the uploader with a FASTA file and accompanying metadata file in [JSON-LD format](https://json-ld.org/): +Run the uploader with a FASTA or FASTQ file and accompanying metadata file in JSON or YAML: ```sh -bh20-seq-uploader example/sequence.fasta example/metadata.json +bh20-seq-uploader example/sequence.fasta example/metadata.yaml ``` ## Workflow for Generating a Pangenome diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index bfc7762..383ef84 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -184,15 +184,17 @@ def receive_files(): # We're going to work in one directory per request dest_dir = tempfile.mkdtemp() + # The uploader will happily accept a FASTQ with this name fasta_dest = os.path.join(dest_dir, 'fasta.fa') metadata_dest = os.path.join(dest_dir, 'metadata.json') try: if 'fasta' not in request.files: return (render_template('error.html', - error_message="You did not include a FASTA file."), 403) + error_message="You did not include a FASTA or FASTQ file."), 403) try: with open(fasta_dest, 'wb') as out_stream: - copy_with_limit(request.files.get('fasta').stream, out_stream) + # Use a plausible file size limit for a little FASTQ + copy_with_limit(request.files.get('fasta').stream, out_stream, limit=50*1024*1024) except FileTooBigError as e: # Delegate to the 413 error handler return handle_large_file(e) diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html index 2934a7c..e722ab3 100644 --- a/bh20simplewebuploader/templates/form.html +++ b/bh20simplewebuploader/templates/form.html @@ -13,9 +13,9 @@


- +
- +
-- cgit v1.2.3 From 54efd8a9e08032929f3f779c438f51472b5aabda Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Sat, 11 Apr 2020 02:56:20 +0300 Subject: Make CSS responsive for smaller screens --- bh20simplewebuploader/templates/form.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html index 6720ec7..8ce6f6f 100644 --- a/bh20simplewebuploader/templates/form.html +++ b/bh20simplewebuploader/templates/form.html @@ -99,6 +99,13 @@ width: 17em; justify-self: center; } + + @media only screen and (max-device-width: 480px) { + .grid-container { + display: flex; + flex-direction: column; + } + } -- cgit v1.2.3 From a764f0496f47f5c93f2a6915d00c8a1e89df0712 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Fri, 10 Apr 2020 17:13:03 -0700 Subject: Fix source link again --- bh20simplewebuploader/templates/form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html index e870b66..986581f 100644 --- a/bh20simplewebuploader/templates/form.html +++ b/bh20simplewebuploader/templates/form.html @@ -174,7 +174,7 @@

- Source · Made for COVID-19-BH20 + Source · Made for COVID-19-BH20