From 04fbb2f014682e183415476ba288d2070701432c Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 12 Nov 2024 19:01:58 +0200 Subject: [PATCH] make it sleeker --- files/routes/search.py | 8 ++++++++ files/templates/userpage/header.html | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/files/routes/search.py b/files/routes/search.py index d3afdc5ca..9d62b6212 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -53,6 +53,10 @@ def searchparse(text): def searchposts(v): query = request.values.get("q", '').strip() + author = request.values.get('author') + if author: + return redirect(f"/search/posts?q=author:{author} {query}") + criteria = searchparse(query) if 'post' in criteria: @@ -197,6 +201,10 @@ def searchposts(v): def searchcomments(v): query = request.values.get("q", '').strip() + author = request.values.get('author') + if author: + return redirect(f"/search/comments?q=author:{author} {query}") + page = get_page() sort = request.values.get("sort", "new").lower() diff --git a/files/templates/userpage/header.html b/files/templates/userpage/header.html index 605fc789f..f614b5625 100644 --- a/files/templates/userpage/header.html +++ b/files/templates/userpage/header.html @@ -39,8 +39,10 @@ -