about summary refs log tree commit diff
path: root/uploader
diff options
context:
space:
mode:
Diffstat (limited to 'uploader')
-rw-r--r--uploader/phenotypes/views.py15
-rw-r--r--uploader/static/css/theme.css4
-rw-r--r--uploader/templates/genotypes/list-genotypes.html58
-rw-r--r--uploader/templates/phenotypes/review-job-data.html37
4 files changed, 97 insertions, 17 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 23bc682..c03f3f5 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -317,6 +317,11 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable=
         dataset_shortname = (
             form["dataset-shortname"] or form["dataset-name"]).strip()
         _pheno_dataset = save_new_dataset(
+            # It's not necessary to update the authorisation server to register
+            # new phenotype resource here, since each phenotype trait can, in
+            # theory, have its own access control allowing/disallowing access to
+            # it. In practice, however, we tend to gather multiple traits into a
+            # single resource for access control.
             cursor,
             population["Id"],
             form["dataset-name"].strip(),
@@ -662,6 +667,8 @@ def review_job_data(
                                        conn, int(_job_metadata["publicationid"]))
                                    if _job_metadata.get("publicationid")
                                    else None),
+                               user=session.user_details(),
+                               timestamp=datetime.datetime.now().isoformat(),
                                activelink="add-phenotypes")
 
 
@@ -741,9 +748,15 @@ def load_data_to_database(
                     "publication_id": _meta["publicationid"],
                     "authserver": oauth2client.authserver_uri(),
                     "token": token["access_token"],
+                    "dataname": request.form["data_name"].strip(),
                     "success_handler": (
                         "uploader.phenotypes.views"
-                        ".load_phenotypes_success_handler")
+                        ".load_phenotypes_success_handler"),
+                    **{
+                        key: request.form[key]
+                        for key in ("data_description",)
+                        if key in request.form.keys()
+                    }
                 },
                 external_id=session.logged_in_user_id())
         ).then(
diff --git a/uploader/static/css/theme.css b/uploader/static/css/theme.css
index 276978f..6f5cb0c 100644
--- a/uploader/static/css/theme.css
+++ b/uploader/static/css/theme.css
@@ -81,10 +81,10 @@ table.dataTable tbody tr.selected td {
     background-color: #ffee99 !important;
 }
 
-.form-group {
+#frm-add-phenotypes .form-group {
     margin-bottom: 2em;
     padding-bottom: 0.2em;
-    border-bottom: solid gray 1px;
+    border-bottom: solid #A9A9A9 1px;
 }
 
 
diff --git a/uploader/templates/genotypes/list-genotypes.html b/uploader/templates/genotypes/list-genotypes.html
index fd84c2f..be297a4 100644
--- a/uploader/templates/genotypes/list-genotypes.html
+++ b/uploader/templates/genotypes/list-genotypes.html
@@ -54,17 +54,34 @@
 </div>
 
 <div class="row">
-  <h2>Genetic Markers</h2>
-  <p>There are a total of {{total_markers}} currently registered genetic markers
-    for the "{{species.FullName}}" species. You can click
-    <a href="{{url_for('species.populations.genotypes.list_markers',
-             species_id=species.SpeciesId,
-             population_id=population.Id)}}"
-       title="View genetic markers for species '{{species.FullName}}"
-       target="_blank">
-      here to view the genetic markers
-    </a>.
-  </p>
+  <h2 class="subheading">Genetic Markers</h2>
+
+  <table id="tbl-genetic-markers" class="table compact stripe cell-border"
+         data-genetic-markers='{{genetic_markers | tojson}}'>
+    <thead>
+      <tr>
+        <th title="">Index</th>
+        <th title="">Marker Name</th>
+        <th title="Chromosome">Chr</th>
+        <th title="Physical location of the marker in megabasepairs">
+          Location (Mb)</th>
+        <th title="">Source</th>
+        <th title="">Source2</th>
+    </thead>
+
+    <tbody>
+      {%for marker in markers%}
+      <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+      </tr>
+      {%endfor%}
+    </tbody>
+  </table>
 </div>
 
 <div class="row text-danger">
@@ -133,3 +150,22 @@
     all the rest.</p>
 </div>
 {%endblock%}
+
+
+{%block javascript%}
+<script type="text/javascript">
+  $(function() {
+      var dtGeneticMarkers = buildDataTable(
+          "#tbl-genetic-markers",
+          JSON.parse($("#tbl-genetic-markers").attr("data-genetic-markers")),
+          [
+              {data: 'index'},
+              {data: 'Name'},
+              {data: 'Chr'},
+              {data: 'Mb'},
+              {data: 'Source'},
+              {data: 'Source2'}
+          ]);
+  })
+</script>
+{%endblock%}
diff --git a/uploader/templates/phenotypes/review-job-data.html b/uploader/templates/phenotypes/review-job-data.html
index c8355b2..0e8f119 100644
--- a/uploader/templates/phenotypes/review-job-data.html
+++ b/uploader/templates/phenotypes/review-job-data.html
@@ -70,6 +70,9 @@
   {%endif%}
   {%endfor%}
   </ul>
+</div>
+
+<div class="row">
 
   <form id="frm-review-phenotype-data"
         method="POST"
@@ -78,10 +81,38 @@
                 population_id=population.Id,
                 dataset_id=dataset.Id)}}">
     <input type="hidden" name="data-qc-job-id" value="{{job.jobid}}" />
-    <input type="submit"
-           value="continue"
-           class="btn btn-primary" />
+    <div class="form-group">
+      <label for="txt-data-name">data name</label>
+      <input type="text"
+             id="txt-data-name"
+             class="form-control"
+             name="data_name"
+             title="A short, descriptive name for this data."
+             placeholder="{{user.email}} - {{dataset.Name}} - {{timestamp}}"
+             value="{{user.email}} - {{dataset.Name}} - {{timestamp}}"
+             required="required">
+      <span class="form-text text-muted">
+        This is a short, descriptive name for the data. It is useful to humans,
+        enabling them identify what traits each data "resource" wraps around.
+      </span>
+    </div>
+
+    {%if view_under_construction%}
+    <div class="form-group">
+      <label for="txt-data-description">data description</label>
+      <textarea id="txt-data-description"
+                class="form-control"
+                name="data_description"
+                title="A longer description for this data."
+                rows="5"></textarea>
+      <span class="form-text text-muted">
+      </span>
+    </div>
+    {%endif%}
+
+    <button type="submit" class="btn btn-primary">continue</button>
   </form>
+
 </div>
 {%else%}
 <div class="row">