From f7e627156ab3e4c172082ea7f19e5e4001ba5837 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 20 Mar 2023 15:57:43 +0300 Subject: Add link to diff page when sample-data is updated * wqflask/wqflask/metadata_edits.py (update_phenotype): Add url to diff page in flash message. * wqflask/wqflask/templates/edit_phenotype.html: Render flash message with HTML. --- wqflask/wqflask/metadata_edits.py | 4 +++- wqflask/wqflask/templates/edit_phenotype.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index eb590408..730c2d44 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -250,7 +250,9 @@ def update_phenotype(dataset_id: str, name: str): } ) f.write(json.dumps(diff_data)) - flash("Sample-data has been successfully uploaded", "success") + url = url_for("metadata_edit.list_diffs") + flash(f"Sample-data has been successfully uploaded. \ +View the diffs here", "success") # Run updates: phenotype_ = { "pre_pub_description": data_.get("pre-pub-desc"), diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html index ea480f4e..cd4f2b60 100644 --- a/wqflask/wqflask/templates/edit_phenotype.html +++ b/wqflask/wqflask/templates/edit_phenotype.html @@ -6,7 +6,7 @@ {% if messages %} {% for category, message in messages %}
-

{{ message }}

+

{{ message|safe }}

{% endfor %} {% endif %} -- cgit v1.2.3