about summary refs log tree commit diff
path: root/uploader/templates/phenotypes/view-phenotype.html
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/phenotypes/view-phenotype.html')
-rw-r--r--uploader/templates/phenotypes/view-phenotype.html107
1 files changed, 70 insertions, 37 deletions
diff --git a/uploader/templates/phenotypes/view-phenotype.html b/uploader/templates/phenotypes/view-phenotype.html
index 99bb8e5..75e3c1e 100644
--- a/uploader/templates/phenotypes/view-phenotype.html
+++ b/uploader/templates/phenotypes/view-phenotype.html
@@ -16,7 +16,7 @@
            species_id=species.SpeciesId,
            population_id=population.Id,
            dataset_id=dataset.Id,
-           xref_id=xref_id)}}">View Datasets</a>
+           xref_id=xref_id)}}">View Phenotype</a>
 </li>
 {%endblock%}
 
@@ -24,8 +24,10 @@
 {{flash_all_messages()}}
 
 <div class="row">
-  <div class="panel panel-default">
-    <div class="panel-heading"><strong>Basic Phenotype Details</strong></div>
+  <div class="card">
+    <div class="card-header">
+      <h5 class="card-title">Basic Phenotype Details</h5>
+    </div>
 
     <table class="table">
       <tbody>
@@ -34,11 +36,7 @@
           <td>{{phenotype.Post_publication_description or phenotype.Pre_publication_abbreviation or phenotype.Original_description}}
         </tr>
         <tr>
-          <td><strong>Cross-Reference ID</strong></td>
-          <td>{{phenotype.xref_id}}</td>
-        </tr>
-        <tr>
-          <td><strong>Collation</strong></td>
+          <td><strong>Database</strong></td>
           <td>{{dataset.FullName}}</td>
         </tr>
         <tr>
@@ -47,38 +45,71 @@
         </tr>
       </tbody>
     </table>
+  </div>
+</div>
 
-    <form action="#edit-delete-phenotype"
-          method="POST"
-          id="frm-delete-phenotype">
+<div class="row" style="margin-top:5px;">
+  <div class="card">
+    <div class="card-header">
+      <h5 class="card-title">Publication Details</h5>
+    </div>
 
-          <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
-          <input type="hidden" name="population_id" value="{{population.Id}}" />
-          <input type="hidden" name="dataset_id" value="{{dataset.Id}}" />
-          <input type="hidden" name="phenotype_id" value="{{phenotype.Id}}" />
+    <div class="card-body">
+      <table class="table">
+        <tbody>
+          <tr>
+            {%for key in ("PubMed_ID", "Authors", "Title", "Journal"):%}
+          <tr>
+            <td><strong>{{key}}</strong></td>
+            <td>{{publication.get(key, "")}}</td>
+          </tr>
+          {%else%}
+          <tr>
+            <td colspan="2" class="text-muted">
+              <span class="glyphicon glyphicon-exclamation-sign"></span>
+              No publication data found.
+            </td>
+          </tr>
+          {%endfor%}
+          </tr>
+        </tbody>
+      </table>
+      <div style="text-align: right;">
+        <a href="{{url_for('publications.edit_publication', publication_id=publication.Id, next=next)}}"
+           class="btn btn-info">edit</a>
+        <a href="#" class="btn btn-danger not-implemented">change</a>
+      </div>
+    </div>
+  </div>
+</div>
 
-          <div class="btn-group btn-group-justified">
-            <div class="btn-group">
-              {%if "group:resource:edit-resource" in privileges%}
-                <input type="submit"
-                       title="Edit the values for the phenotype. This is meant to be used when you need to update only a few values."
-                       class="btn btn-primary not-implemented"
-                       value="edit" />
-                     {%endif%}
-            </div>
-            <div class="btn-group"></div>
-            <div class="btn-group">
-              {%if "group:resource:delete-resource" in privileges%}
-                <input type="submit"
-                       title="Delete the entire phenotype. This is useful when you need to change data for most or all of the fields for this phenotype."
-                       class="btn btn-danger not-implemented"
-                       value="delete" />
-                     {%endif%}
-            </div>
-          </div>
-    </form>
+{%if "group:resource:edit-resource" in privileges
+or "group:resource:delete-resource" in privileges%}
+<div class="row">
+  <div class="btn-group btn-group-justified">
+    <div class="btn-group">
+      {%if "group:resource:edit-resource" in privileges%}
+      <a href="{{url_for('species.populations.phenotypes.edit_phenotype_data',
+               species_id=species.SpeciesId,
+               population_id=population.Id,
+               dataset_id=dataset.Id,
+               xref_id=xref_id)}}"
+         title="Edit the values for the phenotype. This is meant to be used when you need to update only a few values."
+         class="btn btn-primary">Edit</a>
+      {%endif%}
+    </div>
+    <div class="btn-group"></div>
+    <div class="btn-group">
+      {%if "group:resource:delete-resource" in privileges%}
+      <a href="#"
+         title="Delete the entire phenotype. This is useful when you need to change data for most or all of the fields for this phenotype."
+         class="btn btn-danger not-implemented"
+         disabled="disabled">delete</a>
+      {%endif%}
+    </div>
   </div>
 </div>
+{%endif%}
 
 <div class="row">
   <div class="panel panel-default">
@@ -90,9 +121,10 @@
           <th>#</th>
           <th>Sample</th>
           <th>Value</th>
-          <th>Symbol</th>
+          {%if has_se%}
           <th>SE</th>
           <th>N</th>
+          {%endif%}
         </tr>
       </thead>
 
@@ -102,9 +134,10 @@
           <td>{{loop.index}}</td>
           <td>{{item.StrainName}}</td>
           <td>{{item.value}}</td>
-          <td>{{item.Symbol or "-"}}</td>
+          {%if has_se%}
           <td>{{item.error or "-"}}</td>
           <td>{{item.count or "-"}}</td>
+          {%endif%}
         </tr>
         {%endfor%}
       </tbody>