aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gnqa_answer.html
diff options
context:
space:
mode:
authorAlexander_Kabui2024-09-02 12:44:59 +0300
committerAlexander_Kabui2024-09-02 12:44:59 +0300
commitd82f8b31abb0e33c8d01f8906fd6a24d3b268de7 (patch)
treee1f89473af2cb5d3c8de509494959b138a98fe8b /gn2/wqflask/templates/gnqa_answer.html
parent3fed119a47aacdca7d8422735add202e593647cd (diff)
downloadgenenetwork2-d82f8b31abb0e33c8d01f8906fd6a24d3b268de7.tar.gz
Fix spacing for gnqa files.
Diffstat (limited to 'gn2/wqflask/templates/gnqa_answer.html')
-rw-r--r--gn2/wqflask/templates/gnqa_answer.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn2/wqflask/templates/gnqa_answer.html b/gn2/wqflask/templates/gnqa_answer.html
index dc924d3b..6d976382 100644
--- a/gn2/wqflask/templates/gnqa_answer.html
+++ b/gn2/wqflask/templates/gnqa_answer.html
@@ -158,7 +158,7 @@
<script>
function updateRatingHandler(target, responseObj, args){
let {status, response} = responseObj.xhr
- if (status==200 && args == "upvote"){
+ if (status == 200 && args == "upvote"){
htmx.toggleClass(htmx.find('#upvote'), 'btn-success');
htmx.removeClass(htmx.find("#downvote"), "btn-danger");
}
@@ -174,9 +174,9 @@ var answer = {{ answer|tojson }}
var {task_id} = {{ task_id|tojson }}
htmx.on("#upvote", "click", function(evt){
vote_count = htmx.find(".btn-success") ? 0 : 1
- htmx.ajax("POST", `/gnqna/rating/${task_id}/${vote_count}`, {target: "#rate", handler: (target,obj)=> updateRatingHandler(target,obj,"upvote"), swap:"innerHTML",values: {'query': query, 'answer': answer}})});
+ htmx.ajax("POST", `/gnqna/rating/${task_id}/${vote_count}`, {target: "#rate", handler: (target,obj)=> updateRatingHandler(target, obj, "upvote"), swap:"innerHTML",values: {'query': query, 'answer': answer}})});
htmx.on("#downvote", "click", function(evt){
vote_count = htmx.find(".btn-danger") ? 0 : -1
- htmx.ajax("POST", `/gnqna/rating/${task_id}/${vote_count}`, {target: "#rate",handler: (target,obj)=> updateRatingHandler(target,obj,"downvote") , swap:"innerHTML",values: {'query': query, 'answer': answer}})});
+ htmx.ajax("POST", `/gnqna/rating/${task_id}/${vote_count}`, {target: "#rate",handler: (target,obj)=> updateRatingHandler(target,obj, "downvote") , swap:"innerHTML",values: {'query': query, 'answer': answer}})});
</script>
{% endblock %}