From 0a8fdbf4084c064c6839e6283781ede09983e742 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 13 Jun 2024 12:02:36 -0500 Subject: Clean up landing page Leave only data upload type selection on landing page. --- qc_app/entry.py | 12 +++-- qc_app/static/js/select_platform.js | 2 +- qc_app/templates/index.html | 80 ++------------------------------- qc_app/templates/select_species.html | 87 ++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 82 deletions(-) create mode 100644 qc_app/templates/select_species.html (limited to 'qc_app') diff --git a/qc_app/entry.py b/qc_app/entry.py index 94bbd53..d23a45a 100644 --- a/qc_app/entry.py +++ b/qc_app/entry.py @@ -84,20 +84,24 @@ def zip_file_errors(filepath, upload_dir) -> Tuple[str, ...]: return zfile_errors -@entrybp.route("/", methods=["GET", "POST"]) +@entrybp.route("/", methods=["GET"]) +def index(): + """Load the landing page""" + return render_template("index.html") + +@entrybp.route("/upload", methods=["GET", "POST"]) def upload_file(): """Enables uploading the files""" if request.method == "GET": return render_template( - "index.html", species=with_db_connection(species)) + "select_species.html", species=with_db_connection(species)) upload_dir = app.config["UPLOAD_FOLDER"] request_errors = errors(request) if request_errors: for error in request_errors: flash(error, "alert-error error-expr-data") - return render_template( - "index.html", species=with_db_connection(species)), 400 + return redirect(url_for("entry.upload_file")) filename = secure_filename(request.files["qc_text_file"].filename) if not os.path.exists(upload_dir): diff --git a/qc_app/static/js/select_platform.js b/qc_app/static/js/select_platform.js index 456cfcf..4fdd865 100644 --- a/qc_app/static/js/select_platform.js +++ b/qc_app/static/js/select_platform.js @@ -12,7 +12,7 @@ function radio_column(chip) { function setup_genechips(genechip_data) { columns = ["GeneChipId", "GeneChipName"] submit_button = document.querySelector( - "#select-platform-form input[type='submit']"); + "#select-platform-form button[type='submit']"); elt = document.getElementById( "genechips-table").getElementsByTagName("tbody")[0]; remove_children(elt); diff --git a/qc_app/templates/index.html b/qc_app/templates/index.html index 0d301f5..997c1e5 100644 --- a/qc_app/templates/index.html +++ b/qc_app/templates/index.html @@ -60,59 +60,9 @@ -
- upload expression data - {{flash_messages("error-expr-data")}} - -
- - -
- -
- file type - -
- - -
- -
- - -
-
- -
- - - -
- - -
- -{{upload_progress_indicator()}} + upload Samples/Cases
@@ -131,27 +81,3 @@
{%endblock%} - - -{%block javascript%} - - -{%endblock%} diff --git a/qc_app/templates/select_species.html b/qc_app/templates/select_species.html new file mode 100644 index 0000000..30f99b4 --- /dev/null +++ b/qc_app/templates/select_species.html @@ -0,0 +1,87 @@ +{%extends "base.html"%} +{%from "flash_messages.html" import flash_messages%} +{%from "upload_progress_indicator.html" import upload_progress_indicator%} + +{%block title%}Data Upload{%endblock%} + +{%block contents%} +
+
+ upload expression data + {{flash_messages("error-expr-data")}} + +
+ + +
+ +
+ file type + +
+ + +
+ +
+ + +
+
+ +
+ + + +
+ + +
+ + {{upload_progress_indicator()}} +
+{%endblock%} + + +{%block javascript%} + + +{%endblock%} -- cgit v1.2.3