diff options
author | Alexander_Kabui | 2024-05-22 13:53:32 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-22 13:53:32 +0300 |
commit | cfbb1a847d20a726ff286734cba3fa429b4e93c4 (patch) | |
tree | f71d1c5a751c364e3615ce2e9b639f8b8acda1dd /gn2/wqflask/templates | |
parent | 16f978ecdaf450cfa700bd6e78194831ed9a8f57 (diff) | |
download | genenetwork2-cfbb1a847d20a726ff286734cba3fa429b4e93c4.tar.gz |
Refactor template code for gnqa search history
Diffstat (limited to 'gn2/wqflask/templates')
-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> |