diff options
author | Alexander Kabui | 2024-08-30 16:47:55 +0300 |
---|---|---|
committer | GitHub | 2024-08-30 16:47:55 +0300 |
commit | ed20621c23a9a41152f3d6a48334f2a31c018033 (patch) | |
tree | 5e2182b99f5f05e2f667dfce1b762921c4ec62dc /gn2/wqflask/templates/gnqa_search_history.html | |
parent | 9a345d8abf2f0045b2c47bfcf1ae5860273452be (diff) | |
parent | 6db49002d4d2e69fcf4fdd6be6aceeea7b95664f (diff) | |
download | genenetwork2-ed20621c23a9a41152f3d6a48334f2a31c018033.tar.gz |
Merge pull request #861 from genenetwork/feature/gnqa-search-2
Feature/gnqa search 2
Diffstat (limited to 'gn2/wqflask/templates/gnqa_search_history.html')
-rw-r--r-- | gn2/wqflask/templates/gnqa_search_history.html | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/gn2/wqflask/templates/gnqa_search_history.html b/gn2/wqflask/templates/gnqa_search_history.html index 2c07b8c0..976fd7fd 100644 --- a/gn2/wqflask/templates/gnqa_search_history.html +++ b/gn2/wqflask/templates/gnqa_search_history.html @@ -1,42 +1,52 @@ -<section class="container-fluid gnqa-copy"> +<section class="container-fluid gnqa-copy" id="search-hist"> <header class="row"> - <div class="panel panel default col-sm-6 col-sm-offset-3"> <div class="panel panel-default"> <div class="panel-heading"> <div> - <h4 class="text-primary">You search History </h4> + <h4 class="text-secondary" style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif;font-size:2.3rem">Your AI search History </h4> </div> </div> </div> </div> </header> <div class="container row"> - <div class="panel panel-default col-sm-6 col-sm-offset-3 "> - {% for record in prev_queries %} - <div class="panel-body"> - <div class="row"> - <input name="" type="checkbox" value="" class="col-sm-1"> + <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" style="overflow-y:scroll"> + {% for item in prev_queries %} + <li class="row list-group-item"> + <input name="" type="checkbox" value="{{item['task_id']}}" class="col-sm-1" style="height: 20px; + width: 20px;"> <div class="col-sm-10"> - {% for id,val in record.items() %} <button - hx-get="/gnqna/hist/search/{{id}}" + hx-get="/gnqna/hist?query={{item['query']}}&search_term={{item['task_id']}}" hx-target="#swap" hx-swap="innerHTML" hx-trigger= "click" data-bs-toggle="tooltip" data-bs-placement="left" - title="/gnqna/hist/search?{{id}}" + title="/gnqna/hist?query={{item['query']}}&search_term={{item['task_id']}}" style="background:transparent;border:none;cursor:pointer" > - <b class="text-info">{{val}} </b> + <p class="text-info">{{item.get('query')}} </p> </button> - {% endfor %} - </div> - </div> - </div> - {% endfor %} + </div> + </li> + {% endfor %} + </ul> </div> </div> </div> - </section> +</section> +<script> + htmx.on("#delete-btn", "click", function(evt){ + htmx.ajax("DELETE","/gnqna/hist", {target: "#search-hist","swap" :"outerHTML", + values: Array.from(htmx.findAll("input[type=checkbox]:checked"), e => e.value)}) + }) +</script> |