about summary refs log tree commit diff
path: root/uploader/templates/samples/select-population.html
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/samples/select-population.html')
-rw-r--r--uploader/templates/samples/select-population.html117
1 files changed, 26 insertions, 91 deletions
diff --git a/uploader/templates/samples/select-population.html b/uploader/templates/samples/select-population.html
index da19ddc..8e22ac1 100644
--- a/uploader/templates/samples/select-population.html
+++ b/uploader/templates/samples/select-population.html
@@ -1,99 +1,34 @@
-{%extends "base.html"%}
-{%from "flash_messages.html" import flash_messages%}
+{%extends "samples/base.html"%}
+{%from "flash_messages.html" import flash_all_messages%}
+{%from "populations/macro-select-population.html" import select_population_form%}
+{%from "species/macro-display-species-card.html" import display_species_card%}
 
-{%block title%}Select Grouping/Population{%endblock%}
+{%block title%}Samples — Select Population{%endblock%}
 
-{%block contents%}
-<h1 class="heading">Select grouping/population</h1>
-
-<div>
-  <p>We organise the samples/cases/strains in a hierarchichal form, starting
-    with <strong>species</strong> at the very top. Under species, we have a
-    grouping in terms of the relevant population
-    (e.g. Inbred populations, cell tissue, etc.)</p>
-</div>
-
-<form method="POST" action="{{url_for('samples.select_population',
-                            species_id=species.SpeciesId)}}">
-  <legend class="heading">select grouping/population</legend>
-  {{flash_messages("error-select-population")}}
-
-  <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
-
-  <div class="form-group">
-    <label for="select:inbredset" class="form-label">grouping/population</label>
-    <select id="select:inbredset"
-	    name="inbredset_id"
-	    required="required"
-	    class="form-control">
-      <option value="">Select a grouping/population</option>
-      {%for pop in populations%}
-      <option value="{{pop.InbredSetId}}">
-	{{pop.InbredSetName}} ({{pop.FullName}})</option>
-      {%endfor%}
-    </select>
-  </div>
-
-  <button type="submit" class="btn btn-primary">select population</button>
-</form>
-
-<p style="color:#FE3535; padding-left:20em; font-weight:bolder;">OR</p>
-
-<form method="POST" action="{{url_for('samples.create_population',
-                            species_id=species.SpeciesId)}}">
-  <legend class="heading">create new grouping/population</legend>
-  {{flash_messages("error-create-population")}}
+{%block pagetitle%}Samples &mdash; Select Population{%endblock%}
 
-  <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
-  <div class="form-group">
-    <legend>mandatory</legend>
 
-    <label for="txt:inbredset-name" class="form-label">name</label>
-    <input id="txt:inbredset-name"
-	   name="inbredset_name"
-	   type="text"
-	   required="required"
-	   placeholder="Enter grouping/population name"
-	   class="form-control" />
-
-    <label for="txt:" class="form-label">full name</label>
-    <input id="txt:inbredset-fullname"
-	   name="inbredset_fullname"
-	   type="text"
-	   required = "required"
-	   placeholder="Enter the grouping/population's full name"
-	   class="form-control" />
-  </div>
-  <div class="form-group">
-    <legend>Optional</legend>
-
-    <label for="num:public" class="form-label">public?</label>
-    <input id="num:public"
-	   name="public"
-	   type="number"
-	   min="0" max="2" value="2"
-	   class="form-control" />
-
-    <label for="txt:inbredset-family" class="form-label">family</label>
-    <input id="txt:inbredset-family"
-	   name="inbredset_family"
-	   type="text"
-	   placeholder="I am not sure what this is about."
-	   class="form-control" />
-
-    <label for="txtarea:" class="form-label">Description</label>
-    <textarea id="txtarea:description"
-	      name="description"
-	      rows="5"
-	      placeholder="Enter a description of this grouping/population"
-	      class="form-control"></textarea>
-  </div>
-
-  <button type="submit" class="btn btn-primary">create grouping/population</button>
-</form>
+{%block contents%}
+{{flash_all_messages()}}
 
+<div class="row">
+  <p>Select the population to use with your samples:</p>
+  {{select_population_form(
+  url_for("species.populations.samples.select_population", species_id=species.SpeciesId),
+  populations)}}
+</div>
+<div class="row">
+  <p><strong>Cannot find your population in the list?</strong></p>
+
+  <p>If you cannot find the population you want in the drop-down above, you can
+    instead,
+    <a href="{{url_for('species.populations.create_population',
+             species_id=species.SpeciesId)}}"
+       title="Create a new population for species '{{species.FullName}},">
+      create a new population</a>.
+</div>
 {%endblock%}
 
-
-{%block javascript%}
+{%block sidebarcontents%}
+{{display_species_card(species)}}
 {%endblock%}