From 16ba1826095332b475e6ab4bbd4481204fae4401 Mon Sep 17 00:00:00 2001
From: Alexander_Kabui
Date: Wed, 20 Dec 2023 23:02:54 +0300
Subject: add gnqna search form for home page
---
wqflask/wqflask/templates/base.html | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 8c29995d..e8690184 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -50,6 +50,7 @@
}
+
.btn-stc {
padding:9px 8px;
@@ -197,6 +198,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wqflask/wqflask/templates/gnqa_answer.html b/wqflask/wqflask/templates/gnqa_answer.html
new file mode 100644
index 00000000..e3d010f0
--- /dev/null
+++ b/wqflask/wqflask/templates/gnqa_answer.html
@@ -0,0 +1,149 @@
+{% extends "base.html" %}
+{% block title %}GNQNA{% endblock %}
+
+{% block content %}
+
+
+
+
+{% block css %}
+
+{% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% if references %}
+
+ {% for reference in references %}
+ -
+
{{ reference.bibInfo }}
+ {{reference.comboTxt}}
+
+ {% endfor %}
+
+ {% else %}
+
No references available.
+ {% endif %}
+
+
+
+
+
+
+
+
+
+{% endblock %}
+
--
cgit 1.4.1
From df6d66288758e90d5a7d226c9f5de2aeeb8c23f8 Mon Sep 17 00:00:00 2001
From: Alexander_Kabui
Date: Wed, 20 Dec 2023 23:11:57 +0300
Subject: code formatting fixes
---
wqflask/wqflask/templates/gnqa.html | 49 -------------------------------------
1 file changed, 49 deletions(-)
diff --git a/wqflask/wqflask/templates/gnqa.html b/wqflask/wqflask/templates/gnqa.html
index 58ece618..bed2627d 100644
--- a/wqflask/wqflask/templates/gnqa.html
+++ b/wqflask/wqflask/templates/gnqa.html
@@ -63,55 +63,6 @@ required placeholder="Ask a Question or Topic ( Genes) " value='' name="querygnq
-
-
-
{% endblock %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--
cgit 1.4.1
From 035b503f28ee32b91e7f6ab09e586571c536609e Mon Sep 17 00:00:00 2001
From: Alexander_Kabui
Date: Wed, 20 Dec 2023 23:45:53 +0300
Subject: code refactoring
---
wqflask/wqflask/views.py | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index ee4d6a59..e7249b28 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -262,22 +262,28 @@ def gsearchtable():
return flask.jsonify(current_page)
-
@app.route("/gnqna",methods =["POST","GET"])
def gnqna():
if request.method == "POST":
results = dict(request.form)
try:
- response = requests.post("http://localhost:5000/gnqa",json=results)
- if response.status_code ==200:
- return render_template("gnqa_answer.html",**response.json())
- return response.json()
- except Exception as e:
- return flask.jsonify({"error occurred":str(e)})
-
- #return render_template("gnqa_answer.html")
+ def __error__(resp):
+ return resp.json()
+ def __success__(resp):
+ return render_template("gnqa_answer.html",**resp.json())
+ return monad_requests.post(
+ urljoin("http://localhost:5000",
+ "/gnqa"),
+ json=results,
+ ).then(
+ lambda resp: resp
+ ).either(
+ __error__, __success__)
+ except Exception as error:
+ return flask.jsonify({"error":str(error)})
return render_template("gnqa.html")
+
@app.route("/gsearch_updating", methods=('POST',))
def gsearch_updating():
result = UpdateGSearch(request.args).__dict__
--
cgit 1.4.1
From 4ef02f138beffda44f86fec4a76a485e4cf4b0e3 Mon Sep 17 00:00:00 2001
From: Alexander_Kabui
Date: Thu, 21 Dec 2023 17:09:53 +0300
Subject: ui code refactoring
---
wqflask/wqflask/templates/base.html | 4 +++-
wqflask/wqflask/templates/gnqa_answer.html | 9 +++++++++
wqflask/wqflask/views.py | 8 ++++----
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index e8690184..1ed47db8 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -201,7 +201,7 @@
@@ -388,6 +388,8 @@ required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name="
let timeToLoad = document.createElement("p");
timeToLoad.innerHTML = "It took your browser " + ((Date.now() - pageLoadStart) / 1000) + " second(s) to render this page";
document.querySelector("footer .row .col-xs-6").appendChild(timeToLoad);
+
+
});