made search a POST to /search be a redirect to a GET /search/<search_term> so that it works with back/forward buttons in the browser

This commit is contained in:
2022-01-19 22:40:47 +11:00
parent a2091f0194
commit 505a5fa813
4 changed files with 23 additions and 16 deletions

View File

@@ -12,9 +12,8 @@
<tr><td><a href="{{url_for('person', id=person.id )}}">{{person.tag}}</td>
<td>
{% if person.num_matches %}
<form id="_{{person.tag}}" method="POST" action="{{url_for('search')}}">
<input type="hidden" name="search_term" value="AI:{{person.tag}}">
<a href="javascript:$('#_{{person.tag}}').submit()">{{person.num_matches}} matches</a></form>
<a href="javascript:st=$('#search_term').val(); document.location.href='/search/AI:{{person.tag}}'">
{{person.num_matches}} matches</a>
{% else %}
No matches
{% endif %}