about summary refs log tree commit diff
path: root/uploader/templates/genotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/genotypes')
-rw-r--r--uploader/templates/genotypes/base.html11
-rw-r--r--uploader/templates/genotypes/create-dataset.html82
-rw-r--r--uploader/templates/genotypes/index.html4
-rw-r--r--uploader/templates/genotypes/list-genotypes.html21
-rw-r--r--uploader/templates/genotypes/list-markers.html5
-rw-r--r--uploader/templates/genotypes/select-population.html16
-rw-r--r--uploader/templates/genotypes/view-dataset.html61
7 files changed, 184 insertions, 16 deletions
diff --git a/uploader/templates/genotypes/base.html b/uploader/templates/genotypes/base.html
index 1b274bf..7d61312 100644
--- a/uploader/templates/genotypes/base.html
+++ b/uploader/templates/genotypes/base.html
@@ -6,7 +6,18 @@
     {%else%}
     class="breadcrumb-item"
     {%endif%}>
+  {%if population is mapping%}
+  <a href="{{url_for('species.populations.genotypes.list_genotypes',
+           species_id=species.SpeciesId,
+           population_id=population.Id)}}">
+    {%if dataset is defined and dataset is mapping%}
+    {{dataset.Name}}
+    {%else%}
+    Genotypes
+    {%endif%}</a>
+  {%else%}
   <a href="{{url_for('species.populations.genotypes.index')}}">Genotypes</a>
+  {%endif%}
 </li>
 {%block lvl4_breadcrumbs%}{%endblock%}
 {%endblock%}
diff --git a/uploader/templates/genotypes/create-dataset.html b/uploader/templates/genotypes/create-dataset.html
new file mode 100644
index 0000000..10331c1
--- /dev/null
+++ b/uploader/templates/genotypes/create-dataset.html
@@ -0,0 +1,82 @@
+{%extends "genotypes/base.html"%}
+{%from "flash_messages.html" import flash_all_messages%}
+{%from "populations/macro-display-population-card.html" import display_population_card%}
+
+{%block title%}Genotypes — Create Dataset{%endblock%}
+
+{%block pagetitle%}Genotypes — Create Dataset{%endblock%}
+
+{%block lvl4_breadcrumbs%}
+<li {%if activelink=="create-dataset"%}
+    class="breadcrumb-item active"
+    {%else%}
+    class="breadcrumb-item"
+    {%endif%}>
+  <a href="{{url_for('species.populations.genotypes.create_dataset',
+           species_id=species.SpeciesId,
+           population_id=population.Id)}}">Create Dataset</a>
+</li>
+{%endblock%}
+
+{%block contents%}
+{{flash_all_messages()}}
+
+<div class="row">
+  <form id="frm-geno-create-dataset"
+        method="POST"
+        action="{{url_for('species.populations.genotypes.create_dataset',
+                species_id=species.SpeciesId,
+                population_id=population.Id)}}">
+    <legend>Create a new Genotype Dataset</legend>
+
+    <div class="form-group">
+      <label for="txt-geno-dataset-name" class="form-label">Name</label>
+      <input type="text"
+             id="txt-geno-dataset-name"
+             name="geno-dataset-name"
+             required="required"
+             class="form-control" />
+      <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>
+    </div>
+
+    <div class="form-group">
+      <label for="txt-geno-dataset-fullname" class="form-label">Full Name</label>
+      <input type="text"
+             id="txt-geno-dataset-fullname"
+             name="geno-dataset-fullname"
+             required="required"
+             class="form-control" />
+      <small class="form-text text-muted">
+        <p>This is a longer, more descriptive name for your dataset.</p></small>
+    </div>
+
+    <div class="form-group">
+      <label for="txt-geno-dataset-shortname"
+             class="form-label">Short Name</label>
+      <input type="text"
+             id="txt-geno-dataset-shortname"
+             name="geno-dataset-shortname"
+             class="form-control" />
+      <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
+          "<strong>Name</strong>" field above.</p></small>
+    </div>
+
+    <div class="form-group">
+      <input type="submit"
+             class="btn btn-primary"
+             value="create dataset"  />
+    </div>
+  </form>
+</div>
+{%endblock%}
+
+{%block sidebarcontents%}
+{{display_population_card(species, population)}}
+{%endblock%}
diff --git a/uploader/templates/genotypes/index.html b/uploader/templates/genotypes/index.html
index e749f5a..b50ebc5 100644
--- a/uploader/templates/genotypes/index.html
+++ b/uploader/templates/genotypes/index.html
@@ -26,3 +26,7 @@
   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 3780f85..0f074fd 100644
--- a/uploader/templates/genotypes/list-genotypes.html
+++ b/uploader/templates/genotypes/list-genotypes.html
@@ -26,7 +26,8 @@
   <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)}}"
+             species_id=species.SpeciesId,
+             population_id=population.Id)}}"
        title="View genetic markers for species '{{species.FullName}}">
       this link to view the genetic markers
     </a>.
@@ -70,7 +71,7 @@
   {%if genocode | length < 1%}
   <a href="#add-genotype-encoding"
      title="Add a genotype encoding system for this population"
-     class="btn btn-primary">
+     class="btn btn-primary not-implemented">
     add genotype encoding
     </a>
   {%endif%}
@@ -96,7 +97,7 @@
     click on the link for the relevant dataset to view a little more information
     about it.</p>
 
-  {%if dataset is defined %}
+  {%if dataset is not none%}
     <table class="table">
       <thead>
         <tr>
@@ -123,12 +124,24 @@
     There is no genotype dataset defined for this population.
   </p>
   <p>
-    <a href="#create-new-genotype-dataset"
+    <a href="{{url_for('species.populations.genotypes.create_dataset',
+             species_id=species.SpeciesId,
+             population_id=population.Id)}}"
        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>
+</div>
 {%endblock%}
 
 {%block sidebarcontents%}
diff --git a/uploader/templates/genotypes/list-markers.html b/uploader/templates/genotypes/list-markers.html
index 9198b44..a705ae3 100644
--- a/uploader/templates/genotypes/list-markers.html
+++ b/uploader/templates/genotypes/list-markers.html
@@ -13,7 +13,8 @@
     class="breadcrumb-item"
     {%endif%}>
   <a href="{{url_for('species.populations.genotypes.list_markers',
-           species_id=species.SpeciesId)}}">List markers</a>
+           species_id=species.SpeciesId,
+           population_id=population.Id)}}">List markers</a>
 </li>
 {%endblock%}
 
@@ -30,6 +31,7 @@
       {%if start_from > 0%}
       <a href="{{url_for('species.populations.genotypes.list_markers',
                species_id=species.SpeciesId,
+               population_id=population.Id,
                start_from=start_from-count,
                count=count)}}">
         <span class="glyphicon glyphicon-backward"></span>
@@ -45,6 +47,7 @@
       {%if start_from + count < total_markers%}
       <a href="{{url_for('species.populations.genotypes.list_markers',
                species_id=species.SpeciesId,
+               population_id=population.Id,
                start_from=start_from+count,
                count=count)}}">
         Next
diff --git a/uploader/templates/genotypes/select-population.html b/uploader/templates/genotypes/select-population.html
index 7c81943..acdd063 100644
--- a/uploader/templates/genotypes/select-population.html
+++ b/uploader/templates/genotypes/select-population.html
@@ -12,20 +12,14 @@
 {{flash_all_messages()}}
 
 <div class="row">
-  <p>
-    You have indicated that you intend to upload the genotypes for species
-    '{{species.FullName}}'. We now just require the population for your
-    experiment/study, and you should be good to go.
-  </p>
-</div>
-
-<div class="row">
-  {{select_population_form(url_for("species.populations.genotypes.select_population",
-  species_id=species.SpeciesId),
-  populations)}}
+  {{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
new file mode 100644
index 0000000..e7ceb36
--- /dev/null
+++ b/uploader/templates/genotypes/view-dataset.html
@@ -0,0 +1,61 @@
+{%extends "genotypes/base.html"%}
+{%from "flash_messages.html" import flash_all_messages%}
+{%from "populations/macro-display-population-card.html" import display_population_card%}
+
+{%block title%}Genotypes: View Dataset{%endblock%}
+
+{%block pagetitle%}Genotypes: View Dataset{%endblock%}
+
+{%block lvl4_breadcrumbs%}
+<li {%if activelink=="view-dataset"%}
+    class="breadcrumb-item active"
+    {%else%}
+    class="breadcrumb-item"
+    {%endif%}>
+  <a href="{{url_for('species.populations.genotypes.view_dataset',
+           species_id=species.SpeciesId,
+           population_id=population.Id,
+           dataset_id=dataset.Id)}}">view dataset</a>
+</li>
+{%endblock%}
+
+{%block contents%}
+{{flash_all_messages()}}
+
+<div class="row">
+  <h2>Genotype Dataset Details</h2>
+  <table class="table">
+    <thead>
+      <tr>
+        <th>Name</th>
+        <th>Full Name</th>
+      </tr>
+    </thead>
+
+    <tbody>
+      <tr>
+        <td>{{dataset.Name}}</td>
+        <td>{{dataset.FullName}}</td>
+      </tr>
+    </tbody>
+  </table>
+</div>
+
+<div class="row text-warning">
+  <h2>Assembly Details</h2>
+
+  <p>Maybe include the assembly details here if found to be necessary.</p>
+</div>
+
+<div class="row">
+  <h2>Genotype Data</h2>
+
+  <p class="text-danger">
+    Provide link to enable uploading of genotype data here.</p>
+</div>
+
+{%endblock%}
+
+{%block sidebarcontents%}
+{{display_population_card(species, population)}}
+{%endblock%}