From a71f641bd893825c3d71fe55d09f40075336a345 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 6 Sep 2024 17:57:57 +0300 Subject: Add a page for searching GeneWiki by symbol. * gn2/wqflask/templates/wiki/search.html: New template. * gn2/wqflask/views.py (search_wiki): New end-point. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/templates/wiki/search.html | 32 ++++++++++++++++++++++++++++++++ gn2/wqflask/views.py | 12 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 gn2/wqflask/templates/wiki/search.html (limited to 'gn2') diff --git a/gn2/wqflask/templates/wiki/search.html b/gn2/wqflask/templates/wiki/search.html new file mode 100644 index 00000000..863d3daa --- /dev/null +++ b/gn2/wqflask/templates/wiki/search.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} +{% block content %} +
+
+
+

+ GeneWiki Entries +

+

+ GeneWiki enables you to enrich the annotation of genes and transcripts. Please submit or edit a GeneWiki note (500 characters max) related to a gene, its transcripts, or proteins. When possible include PubMed identifiers or web resource links (URL addresses). Please ensure that the additions will have widespread use. For additional information, check the GeneWiki help document. +

+ Please enter a gene symbol in the box below and then click submit. +
+
+
+
+
+ + +
+ +
+
+
+{% endblock %} diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index d9c35115..6bd66940 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -1649,3 +1649,15 @@ def edit_wiki(comment_id: int): flash(f"Success: {post_res}", "alert-success") return redirect(url_for("edit_wiki", comment_id=comment_id)) + + +@app.route("/genewiki", methods=["POST", "GET"]) +def search_wiki(): + """Search genewiki for a given symbol""" + if request.method == "GET": + return render_template( + "wiki/search.html", + ) + return redirect(url_for( + "display_genewiki_page", + symbol=request.form.get("search"))) -- cgit v1.2.3