* fixes search template

18l-fix
Dominika Liberda 2021-03-02 17:45:29 +01:00
parent 52cede46fa
commit 89715c7937
4 changed files with 4 additions and 8 deletions

View File

@ -11,4 +11,6 @@ else
echo "Logged in as ${cookies[username]} | <a href='/logout.shs'>Log out</a> | <a href='/feed.shs'>Your feed</a> | <a href='/fav.shs'>Your favourites</a>"
fi
render _ "${cfg[namespace]}/templates/themes/${cfg[template]}/elements/top.t"
strings[query_nice]="$query_nice"
render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/elements/top.t"

View File

@ -1,4 +1,4 @@
<form action='/search.shs'>
<input name='q' type='text'>
<input name='q' type='text' value='{{.query_nice}}'>
<input type='submit' value='Search'>
</form>

View File

@ -1,4 +1 @@
{{.search}}
<input type='submit' value='Search'>
</form><br>
{{.results}}

View File

@ -10,9 +10,6 @@ fi
if [[ "${get_data[q]}" ]]; then
query="${get_data[q]}"
query_nice=$(sed -s 's/+/ /g' <<< "${get_data[q]}")
strings[search]="<form action='/search.shs'><input name='q' type='text' value='$(html_encode "$query_nice")'>"
else
strings[search]="<form action='/search.shs'><input name='q' type='text'>"
fi
if [[ "${get_data[q]}" ]]; then