]> git.ipfire.org Git - ipfire.org.git/commitdiff
blog/docs: Fix putting the search term back into the search box
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Dec 2023 15:41:16 +0000 (15:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Dec 2023 15:41:16 +0000 (15:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/base.html
src/web/base.py

index 247ba0f20a8f736a05211d7292fe92d9ce821c4e..3174959e403c7bb26bc1c75fedce2ed5208ea12a 100644 (file)
@@ -62,7 +62,7 @@
                                                                                        <div class="field">
                                                                                                <div class="control has-icons-left">
                                                                                                        <input class="input" type="text"
-                                                                                                               name="q" {% if "q" in locals() and q %}value="{{ q }}"{% end %}
+                                                                                                               name="q" {% if q %}value="{{ q }}"{% end %}
                                                                                                                placeholder="{{ _("Search Blog...") }}">
                                                                                                        <span class="icon is-small is-left">
                                                                                                                <i class="fas fa-search"></i>
@@ -78,7 +78,7 @@
                                                                                        <div class="field">
                                                                                                <div class="control has-icons-left">
                                                                                                        <input class="input" type="text"
-                                                                                                               name="q" {% if "q" in locals() and q %}value="{{ q }}"{% end %}
+                                                                                                               name="q" {% if q %}value="{{ q }}"{% end %}
                                                                                                                placeholder="{{ _("Search Documentation...") }}">
                                                                                                        <span class="icon is-small is-left">
                                                                                                                <i class="fas fa-search"></i>
index fa4193792aafdcfa96eb376be06b3e5031bbcca9..11406547c62d9ae0dfdd92a90d63ef758dfff16a 100644 (file)
@@ -93,13 +93,14 @@ class BaseHandler(tornado.web.RequestHandler):
                now = datetime.date.today()
 
                ns.update({
-                       "backend" : self.backend,
-                       "debug" : self.application.settings.get("debug", False),
+                       "backend"     : self.backend,
+                       "debug"       : self.application.settings.get("debug", False),
                        "format_size" : util.format_size,
                        "format_time" : util.format_time,
-                       "hostname" : self.hostname,
-                       "now" : now,
-                       "year" : now.year,
+                       "hostname"    : self.hostname,
+                       "now"         : now,
+                       "q"           : None,
+                       "year"        : now.year,
                })
 
                return ns