From fbffae03945e15b3c0300e151a80a341616886ad Mon Sep 17 00:00:00 2001
From: Frederick Muriuki Muriithi
Date: Thu, 10 Aug 2023 10:55:54 +0300
Subject: Bug: Avoid repetition of data. Simplify UI.
---
wqflask/wqflask/metadata_edits.py | 2 +-
wqflask/wqflask/templates/edit_history.html | 63 ++++++++++++-----------------
2 files changed, 27 insertions(+), 38 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 43651525..585ddbb3 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -601,7 +601,7 @@ def show_history(dataset_id: str = "", name: str = ""):
lambda x: x.timestamp)
return render_template(
"edit_history.html",
- diff=diff_data_,
+ diff={key: set(val) for key,val in diff_data_},
version=get_setting("GN_VERSION"),
)
diff --git a/wqflask/wqflask/templates/edit_history.html b/wqflask/wqflask/templates/edit_history.html
index 7538324b..876ab085 100644
--- a/wqflask/wqflask/templates/edit_history.html
+++ b/wqflask/wqflask/templates/edit_history.html
@@ -9,46 +9,35 @@
-
History
+
History
{% if diff %}
-
-
-
- Timestamp |
- Editor |
- Field |
- Diff |
-
- {% 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 timestamp_ = i.timestamp %}
-
- {% else %}
-
- {% set author = "" %}
- {% set timestamp_ = "" %}
-
- {% endif %}
- {{ timestamp_ }} |
- {{ author }} |
- {{ i.diff.field }} |
- {{ i.diff.diff }} |
- {% set ns.display_cell = False %}
-
- {% endfor %}
- {% endfor %}
-
-
+
+
+ Timestamp |
+ Editor |
+ Field |
+ Diff |
+
+
+ {%set ns = namespace(display_ts=True)%}
+ {%for ts, item in diff.items()%}
+ {%set ns.display_ts = True%}
+ {%for the_diff in item%}
+
+ {%if ns.display_ts%}
+ {{ts}} |
+ {%set ns.display_ts = False%}
+ {%endif%}
+ {{the_diff.author}} |
+ {{the_diff.diff.field}} |
+ {{the_diff.diff.diff}} |
+
+ {%endfor%}
+ {%endfor%}
+
+
-
{% endif %}
--
cgit v1.2.3