about summary refs log tree commit diff
path: root/uploader/templates/phenotypes/view-dataset.html
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/phenotypes/view-dataset.html')
-rw-r--r--uploader/templates/phenotypes/view-dataset.html67
1 files changed, 31 insertions, 36 deletions
diff --git a/uploader/templates/phenotypes/view-dataset.html b/uploader/templates/phenotypes/view-dataset.html
index 10fd428..6a261fc 100644
--- a/uploader/templates/phenotypes/view-dataset.html
+++ b/uploader/templates/phenotypes/view-dataset.html
@@ -46,12 +46,32 @@
 </div>
 
 <div class="row">
-  <p><a href="{{url_for('species.populations.phenotypes.add_phenotypes',
-              species_id=species.SpeciesId,
-              population_id=population.Id,
-              dataset_id=dataset.Id)}}"
-        title="Add a bunch of phenotypes"
-        class="btn btn-primary">Add phenotypes</a></p>
+  <div class="col">
+    <a href="{{url_for('species.populations.phenotypes.add_phenotypes',
+             species_id=species.SpeciesId,
+             population_id=population.Id,
+             dataset_id=dataset.Id)}}"
+       title="Add a bunch of phenotypes"
+       class="btn btn-primary">Add phenotypes</a>
+  </div>
+
+  <div class="col">
+    <form id="frm-recompute-phenotype-means"
+          method="POST"
+          action="{{url_for(
+                  'species.populations.phenotypes.recompute_means',
+                  species_id=species['SpeciesId'],
+                  population_id=population['Id'],
+                  dataset_id=dataset['Id'])}}"
+          class="d-flex flex-row align-items-center flex-wrap"
+          style="display: inline;">
+      <input type="submit"
+             title="Compute/Recompute the means for all phenotypes."
+             class="btn btn-info"
+             value="(rec/c)ompute means"
+             id="submit-frm-recompute-phenotype-means" />
+    </form>
+  </div>
 </div>
 
 <div class="row">
@@ -89,7 +109,12 @@
 {%block javascript%}
 <script type="text/javascript">
   $(function() {
+      var species_id = {{species.SpeciesId}};
+      var population_id = {{population.Id}};
+      var dataset_id = {{dataset.Id}};
+      var dataset_name = "{{dataset.Name}}";
       var data = {{phenotypes | tojson}};
+
       var dtPhenotypesList = buildDataTable(
           "#tbl-phenotypes-list",
           data,
@@ -128,36 +153,6 @@
           {
               select: "multi+shift",
               layout: {
-                  top2: {
-                      buttons: [
-                          {
-                              extend: "selectAll",
-                              className: "btn btn-info",
-                              titleAttr: "Click to select ALL records in the table."
-                          },
-                          {
-                              extend: "selectNone",
-                              className: "btn btn-info",
-                              titleAttr: "Click to deselect ANY selected record(s) in the table."
-                          },
-                          {
-                              text: "Bulk Edit (Download Data)",
-                              action: (event, dt, node, config) => {
-                                  alert("Not implemented yet!");
-                              },
-                              className: "btn btn-info",
-                              titleAttr: "Click to download data for editing."
-                          },
-                          {
-                              text: "Bulk Edit (Upload Data)",
-                              action: (event, dt, node, config) => {
-                                  alert("Not implemented yet!")
-                              },
-                              className: "btn btn-info",
-                              titleAttr: "Click to upload edited data you got by clicking the `Bulk Edit (Download Data)` button."
-                          }
-                      ]
-                  },
                   top1Start: {
                       pageLength: {
                           text: "Show _MENU_ of _TOTAL_"