From 90dc71e4a6753fa8a1473ceb8dff2401a6f72096 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 5 May 2021 13:54:01 -0400 Subject: [PATCH] Strip '-site:' filters from query in header template The 'behind the scenes' site filter applied for blocked sites was appearing in the query field when navigating between search categories (all -> images -> news, etc). This prevents the filter from appearing in all except "images", since the image category uses a separate header. This should eventually be addressed when the image page can begin using the standard whoogle header, but until then, the filter will still appear for image searches. --- app/templates/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/header.html b/app/templates/header.html index 4eb7822..b353d92 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -22,7 +22,7 @@ style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; type="text" - value="{{ query }}"> + value="{{ query[:query.find('-site:')] }}"> @@ -54,7 +54,7 @@ name="q" spellcheck="false" type="text" - value="{{ query }}" + value="{{ query[:query.find('-site:')] }}" style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; border-bottom: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '0px' }};">