diff options
author | Munyoki Kilyungi | 2023-11-16 15:00:05 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-11-27 12:32:27 +0300 |
commit | 371c5dded503bb43d90f2c62ecc1422552fc1225 (patch) | |
tree | df9a7d9e811977089c9e3953bd00a8467392f830 | |
parent | 67886f1395ea6ce193e5a55dd557cf85eecb6cf6 (diff) | |
download | genenetwork2-371c5dded503bb43d90f2c62ecc1422552fc1225.tar.gz |
Revamp UI page for publications.
* wqflask/wqflask/templates/publication.html: Update UI. When a
particular metadata item does not show up, show "N/A" instead.
* wqflask/wqflask/views.py (get_publication): Rename
"publication"->"publications".
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r-- | wqflask/wqflask/templates/publication.html | 36 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 4 |
2 files changed, 10 insertions, 30 deletions
diff --git a/wqflask/wqflask/templates/publication.html b/wqflask/wqflask/templates/publication.html index d0f6633e..556d184f 100644 --- a/wqflask/wqflask/templates/publication.html +++ b/wqflask/wqflask/templates/publication.html @@ -25,14 +25,14 @@ </style> {% endblock %} -{% block title %}Dataset: {{ name }}{% endblock %} +{% block title %}Title: {{metadata.title}}{% endblock %} {% block content %} <header class="page-header text-justify"> <h1> {% if metadata.title %} - <u>{{ metadata.title}}</u> + <u><a href="{{ metadata.id }}">{{ metadata.title}}</a></u> {% else %} {{ name }} {% endif %} @@ -47,34 +47,14 @@ <div class="panel-heading"><strong><span class="glyphicon glyphicon-info-sign aria-hidden=true"></span> Details</strong> </div> <div class="panel-body"> <dl class="dl-horizontal"> - {% if metadata.pubMedId %} - <dt>PUBMED</dt> - <dd> - <a href="{{ metadata.pubMedId }}" target="_blank">{{ metadata.pubMedId.split("/")[-1] }}</a> - </dd> - {% endif %} - {% if metadata.abstract %} <dt>Abstract</dt> <dd>{{ metadata.abstract}}</dd> {% endif %} - {% if metadata.month %} <dt>Month</dt> <dd>{{ metadata.month }}</dd> {% endif %} - {% if metadata.pages %} <dt>Pages</dt> <dd>{{ metadata.pages }}</dd> {% endif %} - {% if metadata.volume %} <dt>Volume</dt> <dd>{{ metadata.volume }}</dd> {% endif %} - </dl> + <dt>Abstract</dt> <dd>{{ metadata.abstract or "N/A" }}</dd> + <dt>Journal</dt> <dd>{{ metadata.journal or "N/A" }}</dd> + <dt>Month</dt> <dd>{{ metadata.month or "N/A" }}</dd> + <dt>Page</dt> <dd>{{ metadata.pages or "N/A" }}</dd> + <dt>Year</dt> <dd>{{ metadata.year or "N/A" }}</dd> + </dl> </div> </div> - {% if metadata.phenotypeOfPublication %} - <div class="container"> - <h2>Related Phenotypes:</h2> - <table class="table"> - {% for link in metadata.phenotypeOfPublication %} - <tr> - <td> - <a href="{{ link }}" target="_blank">{{ link }}</a> - </td> - </tr> - {% endfor %} - </table> - - </div> - {% endif %} {% endif %} </div> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index d6fc64e1..315ae938 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1119,12 +1119,12 @@ def search_for_dataset(): results=search ) -@app.route("/publication/<name>", methods=('GET',)) +@app.route("/publications/<name>", methods=('GET',)) def get_publication(name): metadata = requests.get( urljoin( GN3_LOCAL_URL, - f"/api/metadata/publication/{name}") + f"/api/metadata/publications/{name}") ).json() return render_template( "publication.html", |