about summary refs log tree commit diff
path: root/uploader/templates/samples
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/samples')
-rw-r--r--uploader/templates/samples/list-samples.html36
-rw-r--r--uploader/templates/samples/sui-base.html19
-rw-r--r--uploader/templates/samples/sui-list-samples.html98
-rw-r--r--uploader/templates/samples/upload-samples.html2
4 files changed, 135 insertions, 20 deletions
diff --git a/uploader/templates/samples/list-samples.html b/uploader/templates/samples/list-samples.html
index 185e784..aed27c3 100644
--- a/uploader/templates/samples/list-samples.html
+++ b/uploader/templates/samples/list-samples.html
@@ -29,6 +29,19 @@
   </p>
 </div>
 
+<div class="row">
+  <p>
+    <a href="{{url_for('species.populations.samples.upload_samples',
+             species_id=species.SpeciesId,
+             population_id=population.Id)}}"
+       title="Add samples for population '{{population.FullName}}' from species
+              '{{species.FullName}}'."
+       class="btn btn-primary">
+      add samples
+    </a>
+  </p>
+</div>
+
 {%if samples | length > 0%}
 <div class="row">
   <p>
@@ -96,32 +109,17 @@
 
   <p>
     <a href="#"
-       title="Add samples for population '{{population.FullName}}' from species
+       title="Delete samples from population '{{population.FullName}}' from species
               '{{species.FullName}}'."
-       class="btn btn-danger">
+       class="btn btn-danger not-implemented">
       delete all samples
     </a>
   </p>
 </div>
-
 {%else%}
-
 <div class="row">
-  <p>
-    There are no samples entered for this population. Do please go ahead and add
-    the samples for this population by clicking on the button below.
-  </p>
-
-  <p>
-    <a href="{{url_for('species.populations.samples.upload_samples',
-             species_id=species.SpeciesId,
-             population_id=population.Id)}}"
-       title="Add samples for population '{{population.FullName}}' from species
-              '{{species.FullName}}'."
-       class="btn btn-primary">
-      add samples
-    </a>
-  </p>
+  <p>There are no samples entered for this population. Click the "Add Samples"
+    button above, to add some new samples.</p>
 </div>
 {%endif%}
 
diff --git a/uploader/templates/samples/sui-base.html b/uploader/templates/samples/sui-base.html
new file mode 100644
index 0000000..ee08e2e
--- /dev/null
+++ b/uploader/templates/samples/sui-base.html
@@ -0,0 +1,19 @@
+{%extends "populations/sui-base.html"%}
+{%from "populations/macro-display-population-card.html" import display_sui_population_card%}
+
+{%block breadcrumbs%}
+{{super()}}
+<li class="breadcrumb-item">Manage Samples</li>
+{%endblock%}
+
+{%block contents%}
+<div class="row">
+  <h2 class="heading">{{population.FullName}} ({{population.Name}})</h2>
+</div>
+{%endblock%}
+
+
+
+{%block sidebarcontents%}
+{{display_sui_population_card(species, population)}}
+{%endblock%}
diff --git a/uploader/templates/samples/sui-list-samples.html b/uploader/templates/samples/sui-list-samples.html
new file mode 100644
index 0000000..e9ed71a
--- /dev/null
+++ b/uploader/templates/samples/sui-list-samples.html
@@ -0,0 +1,98 @@
+{%extends "samples/sui-base.html"%}
+{%from "flash_messages.html" import flash_all_messages%}
+{%from "populations/macro-select-population.html" import select_population_form%}
+
+{%block title%}Samples &mdash; List Samples{%endblock%}
+
+{%block contents%}
+{{super()}}
+
+<div class="row">
+  <h3 class="subheading">manage samples</h3>
+  {{flash_all_messages()}}
+</div>
+
+<div class="row">
+  <div class="col">
+    <a href="{{url_for('species.populations.samples.upload_samples',
+             species_id=species.SpeciesId,
+             population_id=population.Id)}}"
+       title="Add samples for population '{{population.FullName}}' from species
+              '{{species.FullName}}'."
+       class="btn btn-primary">add new samples</a>
+  </div>
+</div>
+
+{%if samples | length > 0%}
+<div class="row">
+  <p>
+    Population "{{population.FullName}} ({{population.Name}})" already has
+    <strong>{{total_samples}}</strong> samples/individuals entered. You can
+    explore the list of samples in the table below.
+  </p>
+</div>
+
+<div class="row">
+  <div class="col-md-2">
+    {%if offset > 0:%}
+    <a href="{{url_for('species.populations.samples.list_samples',
+             species_id=species.SpeciesId,
+             population_id=population.Id,
+             from=offset-count,
+             count=count)}}">
+      <span class="glyphicon glyphicon-backward"></span>
+      Previous
+    </a>
+    {%endif%}
+  </div>
+
+  <div class="col-md-8" style="text-align: center;">
+    Samples {{offset}} &mdash; {{offset+(count if offset + count < total_samples else total_samples - offset)}} / {{total_samples}}
+                                                                   </div>
+
+  <div class="col-md-2">
+    {%if offset + count < total_samples:%}
+    <a href="{{url_for('species.populations.samples.list_samples',
+             species_id=species.SpeciesId,
+             population_id=population.Id,
+             from=offset+count,
+             count=count)}}">
+      Next
+      <span class="glyphicon glyphicon-forward"></span>
+    </a>
+    {%endif%}
+  </div>
+</div>
+<div class="row">
+  <table class="table">
+    <thead>
+      <tr>
+        <th></th>
+        <th>Name</th>
+        <th>Auxilliary Name</th>
+        <th>Symbol</th>
+        <th>Alias</th>
+      </tr>
+    </thead>
+
+    <tbody>
+      {%for sample in samples%}
+      <tr>
+        <td>{{sample.sequence_number}}</td>
+        <td>{{sample.Name}}</td>
+        <td>{{sample.Name2}}</td>
+        <td>{{sample.Symbol or "-"}}</td>
+        <td>{{sample.Alias or "-"}}</td>
+      </tr>
+      {%endfor%}
+    </tbody>
+  </table>
+</div>
+{%else%}
+<div class="row">
+  <p>There are no samples entered for this population. Click the "Add Samples"
+    button above, to add some new samples.</p>
+</div>
+{%endif%}
+
+{%endblock%}
diff --git a/uploader/templates/samples/upload-samples.html b/uploader/templates/samples/upload-samples.html
index 25d3290..6422094 100644
--- a/uploader/templates/samples/upload-samples.html
+++ b/uploader/templates/samples/upload-samples.html
@@ -66,7 +66,7 @@
     <div class="form-group">
       <label for="file-samples" class="form-label">select file</label>
       <input type="file" name="samples_file" id="file:samples"
-	     accept="text/csv, text/tab-separated-values"
+	     accept="text/csv, text/tab-separated-values, text/plain"
 	     class="form-control" />
     </div>