aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/select_dataset.html
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-07-13 02:37:52 +0300
committerFrederick Muriuki Muriithi2022-07-19 04:59:59 +0300
commit68cf0750ee29d91abf8fe8d0a81426e324b41b12 (patch)
treeed1b752cb63937ebe5d1c5cca812cbd0f7bd65a6 /qc_app/templates/select_dataset.html
parent27032e1876373f9b519275bffbca117f2c96ca1f (diff)
downloadgn-uploader-68cf0750ee29d91abf8fe8d0a81426e324b41b12.tar.gz
Implement dataset selection
- Implement UI enabling selection from existing datasets - Start implementation of UI that enables creation of new dataset
Diffstat (limited to 'qc_app/templates/select_dataset.html')
-rw-r--r--qc_app/templates/select_dataset.html168
1 files changed, 72 insertions, 96 deletions
diff --git a/qc_app/templates/select_dataset.html b/qc_app/templates/select_dataset.html
index 4846f2c..59ead59 100644
--- a/qc_app/templates/select_dataset.html
+++ b/qc_app/templates/select_dataset.html
@@ -1,111 +1,87 @@
{%extends "base.html"%}
+{%from "dbupdate_hidden_fields.html" import hidden_fields%}
{%block title%}Select Dataset{%endblock%}
+{%block css%}
+<link rel="stylesheet" href="/static/css/two-column-with-separator.css" />
+{%endblock%}
+
{%block contents%}
<h1 class="heading">{{filename}}: select dataset</h2>
-<form method="POST" action="{{url_for('dbinsert.insert_data')}}"
- id="select-dataset-form"
- data-menu-content="{{menu_contents}}"
- data-genechips="{{genechips_data}}">
- <input type="hidden" name="filename" value="{{filename}}" />
- <input type="hidden" name="filetype" value="{{filetype}}" />
-
- <fieldset>
- <label for="species" class="form-col-1">species:</label>
- <select id="species" name="species" class="form-col-2">
- {%for row in species:%}
- <option value="{{row[0]}}"
- {%if row[0] == default_species:%}
- selected="selected"
+<div class="two-column-with-separator">
+ <form method="POST" action="{{url_for('dbinsert.insert_data')}}"
+ id="select-dataset-form" class="two-col-sep-col1">
+ <legend>choose existing dataset</legend>
+ {{hidden_fields(
+ filename, filetype, species=species, genechipid=genechipid,
+ studyid=studyid)}}
+
+ <fieldset>
+ <label for="dataset" class="form-col-1">dataset:</label>
+ <select id="dataset" name="dataset" class="form-col-2"
+ {%if datasets | length == 0:%}
+ disabled="disabled"
{%endif%}>
- {{row[1]}}
- </option>
- {%endfor%}
- </select>
- </fieldset>
-
- <fieldset>
- <label for="group" class="form-col-1">group:</label>
- <select id="group" name="group" class="form-col-2">
- {%for grouping, grps in groups.items():%}
- <optgroup label="{{grouping}}">
- {%for group in grps:%}
- <option value="{{group[0]}}">{{group[1]}}</option>
- {%endfor%}
- </optgroup>
- {%endfor%}
- </select>
- </fieldset>
-
- <fieldset>
- <label for="type" class="form-col-1">type:</label>
- <select id="type" name="type" class="form-col-2">
- {%for grouping, typs in types.items():%}
- <optgroup label="{{grouping}}">
- {%for type in typs:%}
- <option value="{{type[0]}}">{{type[1]}}</option>
+ {%for dataset in datasets:%}
+ <option value="{{dataset['Id']}}">
+ [{{dataset["Name"]}}] - {{dataset["FullName"]}}
+ </option>
{%endfor%}
- </optgroup>
- {%endfor%}
- </select>
- </fieldset>
-
- <fieldset>
- <label for="dataset" class="form-col-1">dataset:</label>
- <select id="dataset" name="dataset" class="form-col-2">
- {%for dataset_id, name1, name2 in datasets:%}
- <option value="{{dataset_id}}">[{{name1}}] {{name2}}</option>
- {%endfor%}
- </select>
- </fieldset>
-
- <table id="genechips-table">
- <thead>
- <tr>
- <th>Select</th>
- <th>GeneChip Name</th>
- <th>Name</th>
- <th>GeoPlatform</th>
- <th>GO Tree Value</th>
- </tr>
- </thead>
-
- <tbody>
- {%for chip in genechips:%}
- <tr>
- <td>
- <input type="radio" name="genechipid" value="{{chip['GeneChipId']}}"
- required="required" />
- </td>
- <td>{{chip["GeneChipName"]}}</td>
- <td>{{chip["Name"]}}</td>
- <td>{{chip["GeoPlatform"]}}</td>
- <td>{{chip["GO_tree_value"]}}</td>
- </tr>
- {%else%}
- <tr>
- <td colspan="5">No chips found for selected species</td>
- </tr>
- {%endfor%}
- </tbody>
- </table>
-
- <fieldset>
- <input type="submit" class="btn btn-main form-col-2"
- value="update database" />
- </fieldset>
-
-</form>
+ </select>
+ </fieldset>
+
+ <fieldset>
+ <input type="submit" class="btn btn-main form-col-2"
+ value="update database"
+ {%if datasets | length == 0:%}
+ disabled="disabled"
+ {%endif%} />
+ </fieldset>
+ </form>
+
+ <p class="two-col-sep-separator">OR</p>
+
+ <form method="POST" id="create-dataset-form"
+ class="two-col-sep-col2">
+ <legend>create new dataset</legend>
+ {{hidden_fields(
+ filename, filetype, species=species, genechipid=genechipid,
+ studyid=studyid)}}
+
+ <fieldset>
+ <label for="avgid">average:</label>
+ <select id="avgid" name="avgid" required="required">
+ <option value="">Select averaging method</option>
+ </select>
+ </fieldset>
+
+ <fieldset>
+ <label for="datasetname">name:</label>
+ <input id="datasetname" name="datasetname" type="text" />
+ </fieldset>
+
+ <fieldset>
+ <label for="datasetname2">name 2:</label>
+ <input id="datasetname2" name="datasetname2" type="text" />
+ </fieldset>
+
+ <fieldset>
+ <label for="datasetfullname">full name:</label>
+ <input id="datasetfullname" name="datasetfullname" type="text" />
+ </fieldset>
+
+ <fieldset>
+ <label for="datasetshortname">full name:</label>
+ <input id="datasetshortname" name="datasetshortname" type="text" />
+ </fieldset>
+ </form>
+
+</div>
{%endblock%}
{%block javascript%}
<script type="text/javascript" src="/static/js/dbinsert.js"></script>
-<script type="text/javascript">
- document.getElementById("species").addEventListener("change", update_menu);
- document.getElementById("group").addEventListener("change", update_menu);
- document.getElementById("type").addEventListener("change", update_menu);
-</script>
{%endblock%}