about summary refs log tree commit diff
path: root/uploader/templates/species
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/species')
-rw-r--r--uploader/templates/species/base.html5
-rw-r--r--uploader/templates/species/create-species.html112
-rw-r--r--uploader/templates/species/list-species.html30
-rw-r--r--uploader/templates/species/macro-display-species-card.html18
-rw-r--r--uploader/templates/species/macro-select-species.html85
-rw-r--r--uploader/templates/species/view-species.html11
6 files changed, 157 insertions, 104 deletions
diff --git a/uploader/templates/species/base.html b/uploader/templates/species/base.html
index 04391db..f64f72b 100644
--- a/uploader/templates/species/base.html
+++ b/uploader/templates/species/base.html
@@ -6,7 +6,12 @@
     {%else%}
     class="breadcrumb-item"
     {%endif%}>
+  {%if species is mapping%}
+  <a href="{{url_for('species.view_species', species_id=species.SpeciesId)}}">
+    {{species.Name}}</a>
+  {%else%}
   <a href="{{url_for('species.list_species')}}">Species</a>
+  {%endif%}
 </li>
 {%block lvl2_breadcrumbs%}{%endblock%}
 {%endblock%}
diff --git a/uploader/templates/species/create-species.html b/uploader/templates/species/create-species.html
index 0d0bedf..138dbaa 100644
--- a/uploader/templates/species/create-species.html
+++ b/uploader/templates/species/create-species.html
@@ -19,72 +19,88 @@
 <div class="row">
   <form id="frm-create-species"
         method="POST"
-        action="{{url_for('species.create_species')}}">
+        action="{{url_for('species.create_species', return_to=return_to)}}"
+        class="form-horizontal">
     <legend>Create Species</legend>
 
     {{flash_all_messages()}}
 
+    <input type="hidden" name="return_to" value="{{return_to}}">
+
     <div class="form-group">
-      <label for="txt-taxonomy-id" class="form-label">
+      <label for="txt-taxonomy-id" class="control-label col-sm-2">
         Taxonomy ID</label>
-      <div class="input-group">
-        <input id="txt-taxonomy-id"
-               name="species_taxonomy_id"
-               type="text"
-               class="form-control" />
-        <span class="input-group-btn">
-          <button id="btn-search-taxonid" class="btn btn-info">Search</button>
-        </span>
+      <div class="col-sm-10">
+        <div class="input-group">
+          <input id="txt-taxonomy-id"
+                 name="species_taxonomy_id"
+                 type="text"
+                 class="form-control" />
+          <span class="input-group-btn">
+            <button id="btn-search-taxonid" class="btn btn-info">Search</button>
+          </span>
+        </div>
+        <small class="form-text text-small text-muted">
+          Use
+          <a href="https://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/"
+             title="NCBI's Taxonomy Browser homepage"
+             target="_blank">
+            NCBI's Taxonomy Browser homepage</a> to search for the species you
+          want. If the species exists on NCBI, they will have a Taxonomy ID. Copy
+          that Taxonomy ID to this field, and click "Search" to auto-fill the
+          details.<br />
+          This field is optional.</small>
       </div>
-      <small class="form-text text-small text-muted">Provide the taxonomy ID for
-        your species that can be used to link to external sites like NCBI. Enter
-        the taxonomy ID and click "Search" to auto-fill the form with data.
-        <br />
-        While it is recommended to provide a value for this field, doing so is
-        optional.
-      </small>
     </div>
 
     <div class="form-group">
-      <label for="txt-species-name" class="form-label">Common Name</label>
-      <input id="txt-species-name"
-             name="common_name"
-             type="text"
-             class="form-control"
-             required="required" />
-      <small class="form-text text-muted">Provide the common, possibly
-        non-scientific name for the species here, e.g. Human, Mouse, etc.</small>
+      <label for="txt-species-name" class="control-label col-sm-2">Common Name</label>
+      <div class="col-sm-10">
+        <input id="txt-species-name"
+               name="common_name"
+               type="text"
+               class="form-control"
+               required="required" />
+        <small class="form-text text-muted">This is the day-to-day term used by
+          laymen, e.g. Mouse (instead of Mus musculus), round worm (instead of
+          Ascaris lumbricoides), etc.<br />
+          For species without this, just enter the scientific name.
+        </small>
+      </div>
     </div>
 
     <div class="form-group">
-      <label for="txt-species-scientific" class="form-label">
+      <label for="txt-species-scientific" class="control-label col-sm-2">
         Scientific Name</label>
-      <input id="txt-species-scientific"
-             name="scientific_name"
-             type="text"
-             class="form-control"
-             required="required" />
-      <small class="form-text text-muted">Provide the scientific name for the
-        species you are creating, e.g. Homo sapiens, Mus musculus, etc.</small>
+      <div class="col-sm-10">
+        <input id="txt-species-scientific"
+               name="scientific_name"
+               type="text"
+               class="form-control"
+               required="required" />
+        <small class="form-text text-muted">This is the scientific name for the
+          species e.g. Homo sapiens, Mus musculus, etc.</small>
+      </div>
     </div>
 
     <div class="form-group">
-      <label for="select-species-family" class="form-label">Family</label>
-      <select id="select-species-family"
-              name="species_family"
-              required="required"
-              class="form-control">
-        <option value="">Please select a grouping</option>
-        {%for family in families%}
-        <option value="{{family}}">{{family}}</option>
-        {%endfor%}
-      </select>
-      <small class="form-text text-muted">
-        This is a generic grouping for the species that determines under which
-        grouping the species appears in the GeneNetwork menus</small>
+      <label for="select-species-family" class="control-label col-sm-2">Family</label>
+      <div class="col-sm-10">
+        <select id="select-species-family"
+                name="species_family"
+                required="required"
+                class="form-control">
+          <option value="ungrouped">I do not know what to pick</option>
+          {%for family in families%}
+          <option value="{{family}}">{{family}}</option>
+          {%endfor%}
+        </select>
+        <small class="form-text text-muted">
+          This is a rough grouping of the species.</small>
+      </div>
     </div>
 
-    <div class="form-group">
+    <div class="col-sm-offset-2 col-sm-10">
       <input type="submit"
              value="create new species"
              class="btn btn-primary" />
@@ -113,7 +129,7 @@
               }
               msg = (
                   "Request to '${uri}' failed with message '${textStatus}'. "
-                  + "Please try again later, or fill the details manually.");
+                      + "Please try again later, or fill the details manually.");
               alert(msg);
               console.error(msg, data, textStatus);
               return false;
diff --git a/uploader/templates/species/list-species.html b/uploader/templates/species/list-species.html
index 3f7acc5..64084b0 100644
--- a/uploader/templates/species/list-species.html
+++ b/uploader/templates/species/list-species.html
@@ -29,31 +29,35 @@
     <caption>Available Species</caption>
     <thead>
       <tr>
-        <th>Common Name</th>
-        <th>Scientific Name</th>
-        <th>TaxonId</th>
-        <th>Family / Grouping</th>
-        <th>Use</th>
+        <th></td>
+        <th title="A common, layman's name for the species.">Common Name</th>
+        <th title="The scientific name for the species">Organism Name</th>
+        <th title="An identifier for the species in the NCBI taxonomy database">
+          Taxonomy ID
+        </th>
+        <th title="A generic grouping used internally by GeneNetwork for organising species.">
+          Family
+        </th>
       </tr>
     </thead>
     <tbody>
       {%for species in allspecies%}
       <tr>
+        <td>{{species["sequence_number"]}}</td>
         <td>{{species["SpeciesName"]}}</td>
-        <td>{{species["FullName"]}}</td>
+        <td>
+          <a href="{{url_for('species.view_species',
+                   species_id=species['SpeciesId'])}}"
+             title="View details in GeneNetwork on {{species['FullName']}}">
+            {{species["FullName"]}}
+          </a>
+        </td>
         <td>
           <a href="https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id={{species['TaxonomyId']}}"
              title="View species details on NCBI"
              target="_blank">{{species["TaxonomyId"]}}</a>
         </td>
         <td>{{species.Family}}</td>
-        <td>
-          <a href="{{url_for('species.view_species',
-                   species_id=species['SpeciesId'])}}"
-             title="">
-            {{species["SpeciesName"]}} ({{species["FullName"]}})
-          </a>
-        </td>
       </tr>
       {%else%}
       <tr>
diff --git a/uploader/templates/species/macro-display-species-card.html b/uploader/templates/species/macro-display-species-card.html
index 857c0f0..166c7b9 100644
--- a/uploader/templates/species/macro-display-species-card.html
+++ b/uploader/templates/species/macro-display-species-card.html
@@ -3,13 +3,19 @@
   <div class="card-body">
     <h5 class="card-title">Species</h5>
     <div class="card-text">
-      <dl>
-        <dt>Common Name</dt>
-        <dd>{{species.SpeciesName}}</dd>
+      <table class="table">
+        <tbody>
+          <tr>
+            <td>Common Name</td>
+            <td>{{species.SpeciesName}}</td>
+          </tr>
 
-        <dt>Scientific Name</dt>
-        <dd>{{species.FullName}}</dd>
-      </dl>
+          <tr>
+            <td>Scientific Name</td>
+            <td>{{species.FullName}}</td>
+          </tr>
+        </tbody>
+      </table>
     </div>
   </div>
 </div>
diff --git a/uploader/templates/species/macro-select-species.html b/uploader/templates/species/macro-select-species.html
index 3dbfc95..3714ae4 100644
--- a/uploader/templates/species/macro-select-species.html
+++ b/uploader/templates/species/macro-select-species.html
@@ -1,38 +1,59 @@
+{%from "macro-step-indicator.html" import step_indicator%}
+
 {%macro select_species_form(form_action, species)%}
-{%if species | length > 0%}
-<form method="GET" action="{{form_action}}">
-  <legend>Select Species</legend>
-
-  <div class="form-group">
-    <label for="select-species" class="form-label">Select Species</label>
-    <select id="select-species"
-            name="species_id"
-            class="form-control"
-            required="required">
-      <option value="">Select Species</option>
-      {%for group in species%}
-      {{group}}
-      <optgroup {%if group[0][1] is not none%}
-                label="{{group[0][1].capitalize()}}"
-                {%else%}
-                label="Undefined"
-                {%endif%}>
-        {%for aspecies in group[1]%}
-        <option value="{{aspecies.SpeciesId}}">{{aspecies.MenuName}}</option>
-        {%endfor%}
-      </optgroup>
-      {%endfor%}
-    </select>
+<form method="GET" action="{{form_action}}" class="form-horizontal">
+
+  <h2>{{step_indicator("1")}} What species do you want to work with?</h2>
+
+  {%if species | length != 0%}
+
+  <p class="form-text">Search for, and select the species from the table below
+    and click "Continue"</p>
+
+  <div class="radio">
+    <label for="rdo-cant-find-species"
+           style="font-weight: 1;">
+      <input id="rdo-cant-find-species" type="radio" name="species_id"
+             value="CREATE-SPECIES" />
+      I could not find the species I want (create it).
+    </label>
   </div>
 
-  <div class="form-group">
-    <input type="submit" value="Select" class="btn btn-primary" />
+  <div class="col-sm-offset-10 col-sm-2">
+    <input type="submit"
+           class="btn btn-primary"
+           value="continue" />
   </div>
+
+  <div style="margin-top:3em;">
+    <table id="tbl-select-species" class="table compact stripe"
+           data-species-list='{{species | tojson}}'>
+      <div class="">
+        <thead>
+          <tr>
+            <th></th>
+            <th>Species Name</th>
+          </tr>
+        </thead>
+
+        <tbody></tbody>
+    </table>
+    </div>
+
+    {%else%}
+
+    <label class="control-label" for="rdo-cant-find-species">
+      <input id="rdo-cant-find-species" type="radio" name="species_id"
+             value="CREATE-SPECIES" />
+      There are no species to select from. Create the first one.</label>
+
+    <div class="col-sm-offset-10 col-sm-2">
+      <input type="submit"
+             class="btn btn-primary col-sm-offset-1"
+             value="continue" />
+    </div>
+
+    {%endif%}
+
 </form>
-{%else%}
-<p class="text-danger">
-  <span class="glyphicon glyphicon-exclamation-mark"></span>
-  We could not find species to select from!
-</p>
-{%endif%}
 {%endmacro%}
diff --git a/uploader/templates/species/view-species.html b/uploader/templates/species/view-species.html
index 6942168..2d02f7e 100644
--- a/uploader/templates/species/view-species.html
+++ b/uploader/templates/species/view-species.html
@@ -40,16 +40,17 @@
 
   <ol>
     <li>
-      <a href="#"
-         title="Upload genotypes for {{species.FullName}}">Upload Genotypes</a>
-    </li>
-    <li>
       <a href="{{url_for('species.populations.list_species_populations',
                species_id=species.SpeciesId)}}"
          title="Create/Edit populations for {{species.FullName}}">
         Manage populations</a>
     </li>
-    <li><a href="#" title="">any other action, perhaps &hellip;</a></li>
+    <li>
+      <a href="{{url_for('species.platforms.list_platforms',
+               species_id=species.SpeciesId)}}"
+         title="Create/Edit sequencing platforms for {{species.FullName}}">
+        Manage sequencing platforms</a>
+    </li>
   </ol>