diff options
author | Alexander_Kabui | 2024-05-22 13:53:32 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-08-29 11:48:42 +0300 |
commit | eb740c0007eeb68a8ad6c39308668415fac713f3 (patch) | |
tree | bf363ead492830c5fa73728faa25879276f79274 | |
parent | d4cf281409a5188ef286bad67d3ec80affd6ea14 (diff) | |
download | genenetwork2-eb740c0007eeb68a8ad6c39308668415fac713f3.tar.gz |
Refactor template code for gnqa search history
-rw-r--r-- | gn2/wqflask/templates/gnqa.html | 4 | ||||
-rw-r--r-- | gn2/wqflask/templates/gnqa_search_history.html | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/gn2/wqflask/templates/gnqa.html b/gn2/wqflask/templates/gnqa.html index 8b50fe43..b3bc74fd 100644 --- a/gn2/wqflask/templates/gnqa.html +++ b/gn2/wqflask/templates/gnqa.html @@ -93,7 +93,7 @@ AI Search <small> <sup> - <button class="search-hist-btn" hx-get="/gnqna/hist/" hx-target="#swap" hx-swap="innerHTML" > + <button class="search-hist-btn" hx-get="/gnqna/hist" hx-target="#swap" hx-swap="innerHTML"> [Search History] </button> </sup> @@ -107,7 +107,7 @@ <button class="btn btn-default btn-sm col-xs-1 col-sm-1 col-sm-offset-3" hx-post="/gnqna" hx-target="#swap" - hx-swap="innerHTML" + hx-swap="innerHTML" hx-indicator="#indicator"> <i class="fa fa-search fa-3x" aria-hidden="true" title="Search"></i> <img id="indicator" class="htmx-indicator" src="/static/gif/loader.gif"/> diff --git a/gn2/wqflask/templates/gnqa_search_history.html b/gn2/wqflask/templates/gnqa_search_history.html index 2c07b8c0..af38392a 100644 --- a/gn2/wqflask/templates/gnqa_search_history.html +++ b/gn2/wqflask/templates/gnqa_search_history.html @@ -13,25 +13,23 @@ </header> <div class="container row"> <div class="panel panel-default col-sm-6 col-sm-offset-3 "> - {% for record in prev_queries %} + {% for (key,val) in prev_queries.items() %} <div class="panel-body"> <div class="row"> <input name="" type="checkbox" value="" class="col-sm-1"> <div class="col-sm-10"> - {% for id,val in record.items() %} <button - hx-get="/gnqna/hist/search/{{id}}" + hx-get="/gnqna/hist?search_term={{key}}" 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?search_term={{key}}" style="background:transparent;border:none;cursor:pointer" > - <b class="text-info">{{val}} </b> + <b class="text-info">{{val.get('query')}} </b> </button> - {% endfor %} </div> </div> </div> |