From 09070949cfe5d99b999ce93358a284b9cd7880da Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 3 Nov 2025 13:47:30 -0600 Subject: Improve UI to enable editing publication details. --- uploader/phenotypes/views.py | 8 +--- uploader/templates/phenotypes/view-phenotype.html | 54 ++++++++++++++++------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index 556b5ff..d02018d 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -245,13 +245,7 @@ def view_phenotype(# pylint: disable=[unused-argument] xref_id=xref_id, phenotype=phenotype, has_se=any(bool(item.get("error")) for item in phenotype["data"]), - publish_data={ - key.replace("_", " "): val - for key,val in - (phenotype_publication_data(conn, phenotype["Id"]) or {}).items() - if (key in ("PubMed_ID", "Authors", "Title", "Journal") - and __non_empty__(val)) - }, + publication=(phenotype_publication_data(conn, phenotype["Id"]) or {}), privileges=privileges, activelink="view-phenotype") diff --git a/uploader/templates/phenotypes/view-phenotype.html b/uploader/templates/phenotypes/view-phenotype.html index 21ac501..75e3c1e 100644 --- a/uploader/templates/phenotypes/view-phenotype.html +++ b/uploader/templates/phenotypes/view-phenotype.html @@ -24,8 +24,10 @@ {{flash_all_messages()}}
| Units | {{phenotype.Units}} | - {%for key,value in publish_data.items()%} -
| {{key}} | -{{value}} | -
| - - No publication data found. - | -|