From fdf14becd8913d0e53cfad45bc4045a77e718769 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 4 Sep 2024 13:59:16 +0300 Subject: Remove duplicate sections in wiki history page. * gn2/wqflask/templates/wiki/history.html: Use a for loop to remove duplicate section. * gn2/wqflask/views.py (display_wiki_history): Pass all the entries directly into the template. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/templates/wiki/history.html | 124 +++++++++++--------------------- 1 file changed, 43 insertions(+), 81 deletions(-) (limited to 'gn2/wqflask/templates') diff --git a/gn2/wqflask/templates/wiki/history.html b/gn2/wqflask/templates/wiki/history.html index 32c52b55..bda802d3 100644 --- a/gn2/wqflask/templates/wiki/history.html +++ b/gn2/wqflask/templates/wiki/history.html @@ -5,88 +5,50 @@

GeneWiki Entry History

-

- Most Recent Version: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gene Symbol:{{ most_recent.symbol }}
PubMed IDs: - {% for id in most_recent.pubmed_ids %} - {{ id }}  - {% endfor %} - {% if not most_recent.pubmed_ids %}Not Available{% endif %} -
Web URL:{{ most_recent.web_url or "Not Available" }}
Entry:{{ most_recent.comment }}
Category:{{ '; '.join(most_recent.categories) or "Not Available" }}
Add Time:{{ most_recent.created }}
Reason for Modification:{{ most_recent.reason or "Not Available" }}
-

- Previous Version: -

- {% for version in previous_versions %} + {% for entry in entries %} +

+ {% if loop.index0 == 0 %} + Most Recent Version: + {% elif loop.index0 == 1 %} + Previous Version: + {% endif %} +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Gene Symbol:{{ version.symbol }}
Species:{{ version.species or "Not Available" }}
PubMed IDs: - {% for id in version.pubmed_ids %} - {{ id }}  - {% endfor %} - {% if not most_recent.pubmed_ids %}Not Available{% endif %} -
Web URL:{{ version.web_url or "Not Available " }}
Entry:{{ version.comment }}
Category:{{ '; '.join(version.categories) or "Not Available" }}
Add Time:{{ version.created }}
Reason for Modification:{{ version.reason or "Not Available" }}
Gene Symbol:{{ entry.symbol }}
PubMed IDs: + {% for id in entry.pubmed_ids %} + {{ id }}  + {% endfor %} + {% if not entry.pubmed_ids %}Not Available{% endif %} +
Web URL:{{ entry.web_url or "Not Available" }}
Entry:{{ entry.comment }}
Category:{{ '; '.join(entry.categories) or "Not Available" }}
Add Time:{{ entry.created }}
Reason for Modification:{{ entry.reason or "Not Available" }}
{% endfor %}
-- cgit v1.2.3