From 926262cdaa068e734a69cbda1e7c3f0a834f8922 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Thu, 4 Jul 2024 11:12:21 -0400 Subject: [PATCH] keep keywords in search form. modified: app.py modified: templates/base.html --- app.py | 12 ++++++++++-- templates/base.html | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 5ae36d6..8061551 100644 --- a/app.py +++ b/app.py @@ -145,14 +145,22 @@ def search_page(): username = request.args.get("username", "guest") if not keywords: return render_template( - "search.html", results=[], username=username, error="Keywords are required" + "search.html", + keywords=keywords, + results=[], + username=username, + error="Keywords are required", ) # Call the function to search messages search_results = search_messages(keywords) return render_template( - "search.html", results=search_results, username=username, error=None + "search.html", + keywords=keywords, + results=search_results, + username=username, + error=None, ) diff --git a/templates/base.html b/templates/base.html index 3d9657a..abf89ed 100644 --- a/templates/base.html +++ b/templates/base.html @@ -171,7 +171,7 @@
- +