Fix exception when QueryValues is not provided

(for example on homepage)
This commit is contained in:
magmaus3 2023-06-09 15:51:40 +02:00
parent f9312f3b4b
commit 5455a4aa14
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251

View file

@ -1,7 +1,9 @@
<div class='searchBar'> <div class='searchBar'>
<form action="/search" method="get"> <form action="/search" method="get">
<div class="search_entry"> <div class="search_entry">
{% set QueryValues = "" if not QueryValues %} {% if not QueryValues %}
{% set QueryValues = "" %}
{% endif %}
<input type='text' id="q" name="q" value='{{ QueryValues["q"] if QueryValues["q"] is not none }}' placeholder="Enter a level name or code"/> <input type='text' id="q" name="q" value='{{ QueryValues["q"] if QueryValues["q"] is not none }}' placeholder="Enter a level name or code"/>
<button class="searchButton" id='searchButton' type='submit'>🔍</button> <button class="searchButton" id='searchButton' type='submit'>🔍</button>
</div> </div>