about summary refs log tree commit diff
path: root/uploader/templates
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates')
-rw-r--r--uploader/templates/genotypes/create-dataset.html16
-rw-r--r--uploader/templates/genotypes/index.html32
-rw-r--r--uploader/templates/genotypes/list-genotypes.html228
-rw-r--r--uploader/templates/genotypes/select-population.html25
-rw-r--r--uploader/templates/genotypes/view-dataset.html5
-rw-r--r--uploader/templates/phenotypes/create-dataset.html2
-rw-r--r--uploader/templates/phenotypes/review-job-data.html37
-rw-r--r--uploader/templates/phenotypes/view-dataset.html26
-rw-r--r--uploader/templates/publications/create-publication.html31
9 files changed, 250 insertions, 152 deletions
diff --git a/uploader/templates/genotypes/create-dataset.html b/uploader/templates/genotypes/create-dataset.html
index 10331c1..ff174fb 100644
--- a/uploader/templates/genotypes/create-dataset.html
+++ b/uploader/templates/genotypes/create-dataset.html
@@ -35,13 +35,15 @@
              id="txt-geno-dataset-name"
              name="geno-dataset-name"
              required="required"
-             class="form-control" />
+             class="form-control"
+             value="{{population.Name}}Geno"
+             readonly="readonly" />
       <small class="form-text text-muted">
         <p>This is a short representative, but constrained name for the genotype
           dataset.<br />
-          The field will only accept letters ('A-Za-z'), numbers (0-9), hyphens
-          and underscores. Any other character will cause the name to be
-          rejected.</p></small>
+          It is used internally by the Genenetwork system. Do not change this
+          value.</p>
+      </small>
     </div>
 
     <div class="form-group">
@@ -50,7 +52,8 @@
              id="txt-geno-dataset-fullname"
              name="geno-dataset-fullname"
              required="required"
-             class="form-control" />
+             class="form-control"
+             value="{{population.Name}} Genotypes" />
       <small class="form-text text-muted">
         <p>This is a longer, more descriptive name for your dataset.</p></small>
     </div>
@@ -61,7 +64,8 @@
       <input type="text"
              id="txt-geno-dataset-shortname"
              name="geno-dataset-shortname"
-             class="form-control" />
+             class="form-control"
+             value="{{population.Name}}Geno" />
       <small class="form-text text-muted">
         <p>A short name for your dataset. If you leave this field blank, the
           short name will be set to the same value as the
diff --git a/uploader/templates/genotypes/index.html b/uploader/templates/genotypes/index.html
deleted file mode 100644
index b50ebc5..0000000
--- a/uploader/templates/genotypes/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-{%extends "genotypes/base.html"%}
-{%from "flash_messages.html" import flash_all_messages%}
-{%from "species/macro-select-species.html" import select_species_form%}
-
-{%block title%}Genotypes{%endblock%}
-
-{%block pagetitle%}Genotypes{%endblock%}
-
-
-{%block contents%}
-{{flash_all_messages()}}
-
-<div class="row">
-  <p>
-    This section allows you to upload genotype information for your experiments,
-    in the case that you have not previously done so.
-  </p>
-  <p>
-    We'll need to link the genotypes to the species and population, so do please
-    go ahead and select those in the next two steps.
-  </p>
-</div>
-
-<div class="row">
-  {{select_species_form(url_for("species.populations.genotypes.index"),
-  species)}}
-</div>
-{%endblock%}
-
-{%block javascript%}
-<script type="text/javascript" src="/static/js/species.js"></script>
-{%endblock%}
diff --git a/uploader/templates/genotypes/list-genotypes.html b/uploader/templates/genotypes/list-genotypes.html
index a2b98c8..131576f 100644
--- a/uploader/templates/genotypes/list-genotypes.html
+++ b/uploader/templates/genotypes/list-genotypes.html
@@ -9,19 +9,6 @@
 {{flash_all_messages()}}
 
 <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}}">
-      this link to view the genetic markers
-    </a>.
-  </p>
-</div>
-
-<div class="row">
   <h2>Genotype Encoding</h2>
   <p>
     The genotype encoding used for the "{{population.FullName}}" population from
@@ -56,59 +43,101 @@
   </table>
 
   {%if genocode | length < 1%}
-  <a href="#add-genotype-encoding"
-     title="Add a genotype encoding system for this population"
-     class="btn btn-primary not-implemented">
-    add genotype encoding
+  <div class="col">
+    <a href="#add-genotype-encoding"
+       title="Add a genotype encoding system for this population"
+       class="btn btn-primary not-implemented">
+      define genotype encoding
     </a>
+  </div>
   {%endif%}
 </div>
 
-<div class="row text-danger">
-  <h3>Some Important Concepts to Consider/Remember</h3>
-  <ul>
-    <li>Reference vs. Non-reference alleles</li>
-    <li>In <em>GenoCode</em> table, items are ordered by <strong>InbredSet</strong></li>
-  </ul>
-  <h3>Possible references</h3>
-  <ul>
-    <li>https://mr-dictionary.mrcieu.ac.uk/term/genotype/</li>
-    <li>https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7363099/</li>
-  </ul>
+<div class="row">
+  <h2>Genotype Dataset</h2>
+</div>
+
+{%if dataset is not none%}
+
+<div class="row">
+  <h3>Dataset Details</h3>
+  <table class="table">
+    <thead>
+      <tr>
+        <th>Name</th>
+        <th>Full Name</th>
+      </tr>
+    </thead>
+
+    <tbody>
+      <tr>
+        <td>{{dataset.Name}}</td>
+        <td><a href="{{url_for('species.populations.genotypes.view_dataset',
+                     species_id=species.SpeciesId,
+                     population_id=population.Id,
+                     dataset_id=dataset.Id)}}"
+               title="View details regarding and manage dataset '{{dataset.FullName}}'"
+               target="_blank">
+            {{dataset.FullName}}</a></td>
+      </tr>
+    </tbody>
+  </table>
+
+  <p>
+    To see more information regarding this dataset (e.g. which markers have
+    sample allele data, the allele data itself, etc) click on the "Full Name"
+    link above.</p>
+</div>
+
+<div class="row">
+  <h3>Genotype Markers</h3>
+
+  <div class="row">
+    <p>
+      The table below lists all of the markers that exist for species
+      {{species.SpeciesName}} ({{species.FullName}}), regardless of whether
+      (or not) we have corresponding sample allele data for a particular marker.
+    </p>
+  <table id="tbl-genetic-markers" class="table compact stripe cell-border">
+    <thead>
+      <tr>
+        <th title="">#</th>
+        <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>
+        <td></td>
+      </tr>
+      {%endfor%}
+    </tbody>
+  </table>
 </div>
 
+{%else%}
+
 <div class="row">
-  <h2>Genotype Datasets</h2>
-
-  <p>The genotype data is organised under various genotype datasets. You can
-    click on the link for the relevant dataset to view a little more information
-    about it.</p>
-
-  {%if dataset is not none%}
-    <table class="table">
-      <thead>
-        <tr>
-          <th>Name</th>
-          <th>Full Name</th>
-        </tr>
-      </thead>
-
-      <tbody>
-        <tr>
-          <td>{{dataset.Name}}</td>
-          <td><a href="{{url_for('species.populations.genotypes.view_dataset',
-                       species_id=species.SpeciesId,
-                       population_id=population.Id,
-                       dataset_id=dataset.Id)}}"
-                 title="View details regarding and manage dataset '{{dataset.FullName}}'">
-              {{dataset.FullName}}</a></td>
-        </tr>
-      </tbody>
-    </table>
-  {%else%}
+  <p>
+    Your genotype data will need to be under a dataset. Unfortunately there is
+    currently no dataset defined for this population.
+  </p>
+
   <p class="text-warning">
     <span class="glyphicon glyphicon-exclamation-sign"></span>
-    There is no genotype dataset defined for this population.
+    Click the button below to define the genotype dataset for this population.
   </p>
   <p>
     <a href="{{url_for('species.populations.genotypes.create_dataset',
@@ -117,16 +146,81 @@
        title="Create a new genotype dataset for the '{{population.FullName}}' population for the '{{species.FullName}}' species."
        class="btn btn-primary">
       create new genotype dataset</a></p>
-  {%endif%}
 </div>
-<div class="row text-warning">
-  <p>
-    <span class="glyphicon glyphicon-exclamation-sign"></span>
-    <strong>NOTE</strong>: Currently the GN2 (and related) system(s) expect a
-    single genotype dataset. If there is more than one, the system apparently
-    fails in unpredictable ways.
-  </p>
-  <p>Fix this to allow multiple datasets, each with a different assembly from
-    all the rest.</p>
+
+{%endif%}
+
+<div class="row">
+  <h2>Notes</h2>
+  <div class="row text-danger">
+    <h3>Genetic Markers: Some Important Concepts to Consider/Remember</h3>
+    <ul>
+      <li>Reference vs. Non-reference alleles</li>
+      <li>In <em>GenoCode</em> table, items are ordered by <strong>InbredSet</strong></li>
+    </ul>
+    <h3>Possible references</h3>
+    <ul>
+      <li>https://mr-dictionary.mrcieu.ac.uk/term/genotype/</li>
+      <li>https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7363099/</li>
+    </ul>
+  </div>
+
+  <div class="row text-warning">
+    <h3>Genotype Dataset</h3>
+    <p>
+      <span class="glyphicon glyphicon-exclamation-sign"></span>
+      <strong>NOTE</strong>: Currently the GN2 (and related) system(s) expect a
+      single genotype dataset per population. If there is more than one, the
+      system apparently fails in unpredictable ways.
+    </p>
+  </div>
 </div>
+
+{%endblock%}
+
+
+{%block javascript%}
+<script type="text/javascript">
+
+  $(function() {
+      var dtGeneticMarkers = buildDataTable(
+          "#tbl-genetic-markers",
+          [],
+          [
+              {
+                  data: function(marker) {
+                      return `<input type="checkbox" name="selected-markers" ` +
+                          `id="chk-selected-markers-${marker.Id}-${marker.GenoFreezeId}" ` +
+                          `value="${marker.Id}_${marker.GenoFreezeId}" ` +
+                          `class="chk-row-select" />`;
+                  }
+              },
+              {data: 'index'},
+              {data: "Name", searchable: true},
+              {data: "Chr", searchable: true},
+              {data: "Mb", searchable: true},
+              {data: "Source", searchable: true},
+              {data: "Source2", searchable: true}
+          ],
+          {
+              ajax: {
+                  url: "{{url_for('species.populations.genotypes.list_markers', species_id=species.SpeciesId, population_id=population.Id, dataset_id=dataset.Id)}}",
+                  dataSrc: "markers"
+              },
+              paging: true,
+              scroller: true,
+              scrollY: "50vh",
+              scrollCollapse: true,
+              layout: {
+                  top: "info",
+                  topStart: null,
+                  topEnd: null,
+                  bottom: null,
+                  bottomStart: null,
+                  bottomEnd: null
+              }
+          });
+  });
+
+</script>
 {%endblock%}
diff --git a/uploader/templates/genotypes/select-population.html b/uploader/templates/genotypes/select-population.html
deleted file mode 100644
index acdd063..0000000
--- a/uploader/templates/genotypes/select-population.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{%extends "genotypes/base.html"%}
-{%from "flash_messages.html" import flash_all_messages%}
-{%from "species/macro-display-species-card.html" import display_species_card%}
-{%from "populations/macro-select-population.html" import select_population_form%}
-
-{%block title%}Genotypes{%endblock%}
-
-{%block pagetitle%}Genotypes{%endblock%}
-
-
-{%block contents%}
-{{flash_all_messages()}}
-
-<div class="row">
-  {{select_population_form(url_for("species.populations.genotypes.select_population", species_id=species.SpeciesId), species, populations)}}
-</div>
-{%endblock%}
-
-{%block sidebarcontents%}
-{{display_species_card(species)}}
-{%endblock%}
-
-{%block javascript%}
-<script type="text/javascript" src="/static/js/populations.js"></script>
-{%endblock%}
diff --git a/uploader/templates/genotypes/view-dataset.html b/uploader/templates/genotypes/view-dataset.html
index 1c4eccf..d95a8e3 100644
--- a/uploader/templates/genotypes/view-dataset.html
+++ b/uploader/templates/genotypes/view-dataset.html
@@ -46,8 +46,9 @@
 <div class="row">
   <h2>Genotype Data</h2>
 
-  <p class="text-danger">
-    Provide link to enable uploading of genotype data here.</p>
+  <div class="col" style="margin-bottom: 3px;">
+    <a href="#" class="btn btn-primary not-implemented">upload genotypes</a>
+  </div>
 </div>
 
 {%endblock%}
diff --git a/uploader/templates/phenotypes/create-dataset.html b/uploader/templates/phenotypes/create-dataset.html
index 6eced05..9963953 100644
--- a/uploader/templates/phenotypes/create-dataset.html
+++ b/uploader/templates/phenotypes/create-dataset.html
@@ -49,7 +49,7 @@
              class="form-control"
              {%endif%}
              required="required"
-             disabled="disabled" />
+             readonly="readonly" />
       <small class="form-text text-muted">
         <p>A short representative name for the dataset.</p>
         <p>Recommended: Use the population name and append "Publish" at the end.
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">
diff --git a/uploader/templates/phenotypes/view-dataset.html b/uploader/templates/phenotypes/view-dataset.html
index 3bb2586..fc84757 100644
--- a/uploader/templates/phenotypes/view-dataset.html
+++ b/uploader/templates/phenotypes/view-dataset.html
@@ -148,14 +148,36 @@
                       return `<a href="${url.toString()}" target="_blank">` +
                           `${pheno.InbredSetCode}_${pheno.xref_id}` +
                           `</a>`;
-                  }
+                  },
+                  title: "Record",
+                  visible: true,
+                  searchable: true
               },
               {
                   data: function(pheno) {
                       return (pheno.Post_publication_description ||
                               pheno.Original_description ||
                               pheno.Pre_publication_description);
-                  }
+                  },
+                  title: "Description",
+                  visible: true,
+                  searchable: true
+              },
+              {
+                  data: function(pheno) {
+                      return pheno.publication.Title;
+                  },
+                  title: "Publication Title",
+                  visible: false,
+                  searchable: true
+              },
+              {
+                  data: function(pheno) {
+                      return pheno.publication.Authors;
+                  },
+                  title: "Authors",
+                  visible: false,
+                  searchable: true
               }
           ],
           {
diff --git a/uploader/templates/publications/create-publication.html b/uploader/templates/publications/create-publication.html
index fb0127d..da5889e 100644
--- a/uploader/templates/publications/create-publication.html
+++ b/uploader/templates/publications/create-publication.html
@@ -91,22 +91,22 @@
              class="col-sm-2 col-form-label">
         Month</label>
       <div class="col-sm-4">
-        <select class="form-control"
+        <select class="form-select"
                 id="select-publication-month"
                 name="publication-month">
           <option value="">Select a month</option>
-          <option value="january">January</option>
-          <option value="february">February</option>
-          <option value="march">March</option>
-          <option value="april">April</option>
-          <option value="may">May</option>
-          <option value="june">June</option>
-          <option value="july">July</option>
-          <option value="august">August</option>
-          <option value="september">September</option>
-          <option value="october">October</option>
-          <option value="november">November</option>
-          <option value="december">December</option>
+          <option {%if current_month | lower == "january"%}selected="selected"{%endif%}value="january">January</option>
+          <option {%if current_month | lower == "february"%}selected="selected"{%endif%}value="february">February</option>
+          <option {%if current_month | lower == "march"%}selected="selected"{%endif%}value="march">March</option>
+          <option {%if current_month | lower == "april"%}selected="selected"{%endif%}value="april">April</option>
+          <option {%if current_month | lower == "may"%}selected="selected"{%endif%}value="may">May</option>
+          <option {%if current_month | lower == "june"%}selected="selected"{%endif%}value="june">June</option>
+          <option {%if current_month | lower == "july"%}selected="selected"{%endif%}value="july">July</option>
+          <option {%if current_month | lower == "august"%}selected="selected"{%endif%}value="august">August</option>
+          <option {%if current_month | lower == "september"%}selected="selected"{%endif%}value="september">September</option>
+          <option {%if current_month | lower == "october"%}selected="selected"{%endif%}value="october">October</option>
+          <option {%if current_month | lower == "november"%}selected="selected"{%endif%}value="november">November</option>
+          <option {%if current_month | lower == "december"%}selected="selected"{%endif%}value="december">December</option>
         </select>
         <span class="form-text text-muted">Month of publication</span>
       </div>
@@ -119,7 +119,10 @@
                id="txt-publication-year"
                name="publication-year"
                class="form-control"
-               min="1960" />
+               min="1960"
+               max="{{current_year}}"
+               value="{{current_year or ''}}"
+               required="required" />
         <span class="form-text text-muted">Year of publication</span>
       </div>
     </div>