From 0cd4b09cc56c5dda7bda4ed989ab0ba72c43ac31 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 7 Jun 2023 09:43:52 +0300 Subject: Add publication page * wqflask/wqflask/templates/publication.html: New page. * wqflask/wqflask/views.py (get_dataset): New function. Signed-off-by: Munyoki Kilyungi --- wqflask/wqflask/templates/publication.html | 82 ++++++++++++++++++++++++++++++ wqflask/wqflask/views.py | 13 +++++ 2 files changed, 95 insertions(+) create mode 100644 wqflask/wqflask/templates/publication.html diff --git a/wqflask/wqflask/templates/publication.html b/wqflask/wqflask/templates/publication.html new file mode 100644 index 00000000..d0f6633e --- /dev/null +++ b/wqflask/wqflask/templates/publication.html @@ -0,0 +1,82 @@ +{% extends "base.html" %} + +{% block css %} + +{% endblock %} + +{% block title %}Dataset: {{ name }}{% endblock %} + +{% block content %} + + + +
+ {% if metadata == {} %} +

We appreciate your interest, but unfortunately, we don't have any additional information available for: {{ name }}. If you have any other questions or need assistance with something else, please feel free to reach out to us.

+ {% else %} + + {% if metadata.phenotypeOfPublication %} +
+

Related Phenotypes:

+ + {% for link in metadata.phenotypeOfPublication %} + + + + {% endfor %} +
+ {{ link }} +
+ +
+ {% endif %} + {% endif %} + +
+ +{% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 895ad0cb..d980e5e3 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1118,3 +1118,16 @@ def get_dataset(name): metadata=metadata, float_p=float_p ) + + +@app.route("/publication/", methods=('GET',)) +def get_publication(name): + metadata = requests.get( + urljoin( + GN3_LOCAL_URL, + f"/api/metadata/publication/{name}") + ).json() + return render_template( + "publication.html", + metadata=metadata, + ) -- cgit v1.2.3