aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gnqa_answer.html
diff options
context:
space:
mode:
authorAlexander_Kabui2024-04-03 17:13:08 +0300
committerAlexander_Kabui2024-04-05 15:12:02 +0300
commitf586774026565f10772b342521af8eb90cfb687a (patch)
treeddcdfb3e6e4324cfc29c074548da288e91bf39fd /gn2/wqflask/templates/gnqa_answer.html
parent9f37a05627c37ceab0c438082e4a1edd84b9eac4 (diff)
downloadgenenetwork2-f586774026565f10772b342521af8eb90cfb687a.tar.gz
Update UI for gnqa rating to use htmx.
Diffstat (limited to 'gn2/wqflask/templates/gnqa_answer.html')
-rw-r--r--gn2/wqflask/templates/gnqa_answer.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/gn2/wqflask/templates/gnqa_answer.html b/gn2/wqflask/templates/gnqa_answer.html
index 825b994c..bde39329 100644
--- a/gn2/wqflask/templates/gnqa_answer.html
+++ b/gn2/wqflask/templates/gnqa_answer.html
@@ -5,16 +5,19 @@
<mark style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif;"><b><i>{{ query }}</i></b></mark><br/>
{{ answer }}
</p>
- <div class="rating row" data-doc-id="{{query}}" data-task-id="{{task_id['task_id']}}">
- <button class="btn btn-success" data-toggle="tooltip" data-placement="top" title="Vote Up"><i class="fa fa-thumbs-up fa-sm fa-1x" aria-hidden="true"></i></button>
- <button class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="Vote Down"><i class="fa fa-thumbs-down fa-sm fa-1x" aria-hidden="true"></i></button>
+ <div class="rating row" data-doc-id="{{query}}" data-task-id="{{task_id['task_id']}}"
+ hx-vals='{"query": "{{query}}","answer":"{{answer}}"}'
+ >
+ <button class="btn btn-success" data-toggle="tooltip" data-placement="top" title="Vote Up" hx-post="/gnqna/rating/{{task_id['task_id']}}/1" hx-target="#rate" hx-swap="innerHTML" hx-trigger="click"><i class="fa fa-thumbs-up fa-sm fa-1x" aria-hidden="true"></i></button>
+ <button class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="Vote Down" hx-post="/gnqna/rating/{{task_id['task_id']}}/-1" hx-target="#rate" hx-swap="innerHTML" hx-trigger="click"><i class="fa fa-thumbs-down fa-sm fa-1x" aria-hidden="true"></i></button>
+ <sub id="rate" class="text-info">
+ </sub>
</div>
</div>
<div class="row container">
<details open>
<summary><h3 style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif;">References</h3></summary>
{% if references %}
-
<ul class="list-unstyled">
{% for reference in references %}
<li>