From ee44431de6cf860fe89e796eab2bb0d555d90105 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 12 Jul 2022 08:51:20 +0300 Subject: Add 'group' and 'tissue' selection. - Build code to populate the "Group" and "Tissue" dropdown lists - Enable redirect with POST data (code 307) in case there is input error to enable the user fix their errors - Move hidden fields to macro to reduce repetition --- qc_app/templates/dbupdate_hidden_fields.html | 14 +++++++ qc_app/templates/select_study.html | 55 ++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 qc_app/templates/dbupdate_hidden_fields.html (limited to 'qc_app/templates') diff --git a/qc_app/templates/dbupdate_hidden_fields.html b/qc_app/templates/dbupdate_hidden_fields.html new file mode 100644 index 0000000..cdebeab --- /dev/null +++ b/qc_app/templates/dbupdate_hidden_fields.html @@ -0,0 +1,14 @@ +{%macro hidden_fields(filename, filetype):%} + + + + + +{%if kwargs.get("species"):%} + +{%endif%} +{%if kwargs.get("genechipid"):%} + +{%endif%} + +{%endmacro%} diff --git a/qc_app/templates/select_study.html b/qc_app/templates/select_study.html index 8d7a98b..e4b629c 100644 --- a/qc_app/templates/select_study.html +++ b/qc_app/templates/select_study.html @@ -1,4 +1,5 @@ {%extends "base.html"%} +{%from "dbupdate_hidden_fields.html" import hidden_fields%} {%block title%}Select Dataset{%endblock%} @@ -14,10 +15,7 @@ id="select-platform-form" data-genechips="{{genechips_data}}" class="two-col-sep-col1"> Select from existing study - - - - + {{hidden_fields(filename, filetype, species=species, genechipid=genechipid)}}
@@ -39,19 +37,28 @@

OR

-
+ {%with messages = get_flashed_messages(with_categories=true)%} + {%if messages:%} + + {%endif%} + {%endwith%} Create new study - - - - + {{hidden_fields(filename, filetype, species=species, genechipid=genechipid)}}
+ required="required" + {%if studyname:%} + value="{{studyname}}" + {%endif%} />
@@ -68,13 +75,37 @@
- + + {%for family in groups:%} + + {%for group in groups[family]:%} + + {%endfor%} + + {%endfor%}
- + + {%for tissue in tissues:%} + + {%endfor%}
-- cgit v1.2.3