aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-06-07 18:38:33 +0300
committerBonfaceKilz2021-06-07 18:43:44 +0300
commitb18472ff4cbc6af5c5a72c4160d982b5b664106c (patch)
treea68e75f6af66544d37a11de81c7e4b33f503f9e6
parentd8fa6d066d9c37d65bf6e3388b5bb9583b6a9436 (diff)
downloadgenenetwork2-b18472ff4cbc6af5c5a72c4160d982b5b664106c.tar.gz
templates: edit_trait: Display diffs as a table
-rw-r--r--wqflask/wqflask/templates/edit_trait.html49
1 files changed, 46 insertions, 3 deletions
diff --git a/wqflask/wqflask/templates/edit_trait.html b/wqflask/wqflask/templates/edit_trait.html
index 5dc11e00..c6668683 100644
--- a/wqflask/wqflask/templates/edit_trait.html
+++ b/wqflask/wqflask/templates/edit_trait.html
@@ -5,10 +5,53 @@
Edit Trait for Published Database
Submit Trait | Reset
-{% if publish_xref.comments %}
-<h2>Update History:</h2>
+{% if diff %}
-{{ publish_xref.comments }}
+<div class="container">
+ <details class="col-sm-12 col-md-10 col-lg-12">
+ <summary>
+ <h2>Update History</h2>
+ </summary>
+ <table class="table">
+ <tbody>
+ <tr>
+ <th>Timestamp</th>
+ <th>Editor</th>
+ <th>Field</th>
+ <th>Diff</th>
+ </tr>
+ {% set ns = namespace(display_cell=True) %}
+
+ {% for timestamp, group in diff %}
+ {% set ns.display_cell = True %}
+ {% for i in group %}
+ <tr>
+ {% if ns.display_cell and i.timestamp == timestamp %}
+
+ {% set author = i.author %}
+ {% set field = i.diff.field %}
+ {% set timestamp_ = i.timestamp %}
+
+ {% else %}
+
+ {% set author = "" %}
+ {% set field = "" %}
+ {% set timestamp_ = "" %}
+
+ {% endif %}
+ <td>{{ timestamp_ }}</td>
+ <td>{{ author }} {{ display_cell }}</td>
+ <td>{{ field }}</td>
+ <td><pre>{{ i.diff.diff }}</pre></td>
+ {% set ns.display_cell = False %}
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </tbody>
+ </table>
+ </details>
+
+</div>
{% endif %}