From b18472ff4cbc6af5c5a72c4160d982b5b664106c Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 7 Jun 2021 18:38:33 +0300 Subject: templates: edit_trait: Display diffs as a table --- wqflask/wqflask/templates/edit_trait.html | 49 +++++++++++++++++++++++++++++-- 1 file 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 %} -

Update History:

+{% if diff %} -{{ publish_xref.comments }} +
+
+ +

Update History

+
+ + + + + + + + + {% set ns = namespace(display_cell=True) %} + + {% for timestamp, group in diff %} + {% set ns.display_cell = True %} + {% for i in group %} + + {% 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 %} + + + + + {% set ns.display_cell = False %} + + {% endfor %} + {% endfor %} + +
TimestampEditorFieldDiff
{{ timestamp_ }}{{ author }} {{ display_cell }}{{ field }}
{{ i.diff.diff }}
+
+ +
{% endif %} -- cgit v1.2.3