aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-01-16 13:00:35 +0300
committerFrederick Muriuki Muriithi2024-01-16 13:00:35 +0300
commitb59c2a7f30293c2e26a19745813cdedacdd8c5bc (patch)
treef50608019ea0ad9351e9cd6fc0ad2ea8ae8b8c5d
parent6222ebc5ca0fdeaac9ce7addd07ee4dd900a1afb (diff)
downloadgn-uploader-b59c2a7f30293c2e26a19745813cdedacdd8c5bc.tar.gz
UI: Create UI for creating a new Genotype dataset.
-rw-r--r--qc_app/templates/rqtl2/select-geno-dataset.html56
-rw-r--r--qc_app/upload/rqtl2.py7
2 files changed, 63 insertions, 0 deletions
diff --git a/qc_app/templates/rqtl2/select-geno-dataset.html b/qc_app/templates/rqtl2/select-geno-dataset.html
index c8623b3..3487b6e 100644
--- a/qc_app/templates/rqtl2/select-geno-dataset.html
+++ b/qc_app/templates/rqtl2/select-geno-dataset.html
@@ -52,4 +52,60 @@
</fieldset>
</form>
+<p style="color:#FE3535; padding-left:20em; font-weight:bolder;">OR</p>
+
+<form id="frm-upload-rqtl2-bundle"
+ action="{{url_for('upload.rqtl2.create_geno_dataset',
+ species_id=species.SpeciesId,
+ population_id=population.InbredSetId)}}"
+ method="POST"
+ enctype="multipart/form-data">
+ <legend class="heading">create a new genotype dataset</legend>
+
+ <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
+ <input type="hidden" name="population_id"
+ value="{{population.InbredSetId}}" />
+ <input type="hidden" name="rqtl2_bundle_file"
+ value="{{rqtl2_bundle_file}}" />
+
+ {{flash_messages("error-rqtl2")}}
+
+ <fieldset>
+ <label for="txt:dataset-name">Name</label>
+ <input type="text"
+ id="txt:dataset-name"
+ name="dataset-name"
+ required="required" />
+ </fieldset>
+
+ <fieldset>
+ <label for="txt:dataset-fullname">Full Name</label>
+ <input type="text"
+ id="txt:dataset-fullname"
+ name="dataset-fullname"
+ required="required" />
+ </fieldset>
+
+ <fieldset>
+ <label for="txt:dataset-shortname">Short Name</label>
+ <input type="text"
+ id="txt:dataset-shortname"
+ name="dataset-shortname"
+ required="required" />
+ </fieldset>
+
+ <fieldset>
+ <input type="checkbox"
+ id="chk:dataset-public"
+ name="dataset-public" />
+ <label for="chk:dataset-public">Public?</label>
+ </fieldset>
+
+ <fieldset>
+ <input type="submit"
+ value="create new dataset"
+ class="btn btn-main form-col-2" />
+ </fieldset>
+</form>
+
{%endblock%}
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index e020d5a..f9185b1 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -227,3 +227,10 @@ def select_dataset_info(species_id: int, population_id: int):
def select_geno_dataset(species_id: int, population_id: int) -> Response:
"""Select from existing geno datasets."""
return "IMPLEMENT THIS!!!"
+
+@rqtl2.route(("/upload/species/<int:species_id>/population/<int:population_id>"
+ "/rqtl2-bundle/create-geno-dataset"),
+ methods=["POST"])
+def create_geno_dataset(species_id: int, population_id: int) -> Response:
+ """Create a new geno dataset."""
+ return "IMPLEMENT THIS!!!"