about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-05-24 18:04:25 +0300
committerAlexander_Kabui2024-08-29 11:49:42 +0300
commit801931f2726c1b0032e2d6690387139ff4251bda (patch)
tree47ccbae57fb2ef6c161d590ff2937cbccdad71cf
parente30029041b3f533f5563f3d63f4cba6d1e31519d (diff)
downloadgenenetwork2-801931f2726c1b0032e2d6690387139ff4251bda.tar.gz
Add UI code for gnqa history search delete functionality.
-rw-r--r--gn2/wqflask/templates/gnqa_search_history.html25
1 files changed, 21 insertions, 4 deletions
diff --git a/gn2/wqflask/templates/gnqa_search_history.html b/gn2/wqflask/templates/gnqa_search_history.html
index 890a3995..c1e66541 100644
--- a/gn2/wqflask/templates/gnqa_search_history.html
+++ b/gn2/wqflask/templates/gnqa_search_history.html
@@ -11,12 +11,17 @@
     </div>
   </header>
   <div class="container row">
-    <div class="panel panel-default col-sm-6 col-sm-offset-3 ">
+    <div>
+      <div class="col-sm-6 col-sm-offset-3" style="margin-bottom:10px">
+	<button type="button" class="btn btn-danger" id="delete-btn">Delete Selected </button>
+      </div>
+      <div>
+	<div class="panel panel-default col-sm-6 col-sm-offset-3 ">
       <div>
-	<ul class="list-group list-group-flush">
+	<ul class="list-group list-group-flush" style="overflow-y:scroll">
     {% for item in  prev_queries %}
     <li class="row list-group-item">
-      	<input name="" type="checkbox"  value="" class="col-sm-1" style="height: 20px;
+      	<input name="" type="checkbox"   value="{{item['task_id']}}" class="col-sm-1" style="height: 20px;
   width: 20px;">
 	<div class="col-sm-10">
 	    <button
@@ -38,4 +43,16 @@
    </div>
   </div>
   </div>
- </section>
+</section>
+{% block js %}
+  <script>
+  htmx.on("#delete-btn", "click", function(evt){
+      // todo: complete this for delete /export functionality
+      htmx.ajax("POST", "/gnqna/hist", {target:"",
+				swap:"innerHTML",values:
+			Array.from(htmx.findAll("input[type=checkbox]:checked"), e => e.value);}
+      )
+  })
+</script>
+
+{% endblock %}