From 7d8cfbb19e99679075dedde3a28c7428cf7fa047 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 23 Aug 2022 19:32:17 +0100 Subject: [PATCH] Banner on hashtag search --- daemon.py | 8 ++++++-- webapp_search.py | 23 +++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 5abe4bb91..c778a21bc 100644 --- a/daemon.py +++ b/daemon.py @@ -3902,7 +3902,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.lists_enabled, timezone, bold_reading, self.server.dogwhistles, - self.server.map_format) + self.server.map_format, + self.server.access_keys, + 'search') if hashtag_str: msg = hashtag_str.encode('utf-8') msglen = len(msg) @@ -8606,7 +8608,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.lists_enabled, timezone, bold_reading, self.server.dogwhistles, - self.server.map_format) + self.server.map_format, + self.server.access_keys, + self.server.default_timeline) if hashtag_str: msg = hashtag_str.encode('utf-8') msglen = len(msg) diff --git a/webapp_search.py b/webapp_search.py index 6fc10788a..467a61b63 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -30,6 +30,7 @@ from skills import get_skills_from_list from categories import get_hashtag_category from feeds import rss2tag_header from feeds import rss2tag_footer +from webapp_utils import get_banner_file from webapp_utils import html_common_emoji from webapp_utils import set_custom_background from webapp_utils import html_keyboard_navigation @@ -738,7 +739,8 @@ def html_hashtag_search(nickname: str, domain: str, port: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, timezone: str, bold_reading: bool, - dogwhistles: {}, map_format: str) -> str: + dogwhistles: {}, map_format: str, + access_keys: {}, box_name: str) -> str: """Show a page containing search results for a hashtag or after selecting a hashtag from the swarm """ @@ -784,16 +786,33 @@ def html_hashtag_search(nickname: str, domain: str, port: int, if end_index >= no_of_lines and no_of_lines > 0: end_index = no_of_lines - 1 - # add the page title instance_title = \ get_config_param(base_dir, 'instanceTitle') hashtag_search_form = \ html_header_with_external_style(css_filename, instance_title, None) + if nickname: + # banner at top + banner_file, _ = \ + get_banner_file(base_dir, nickname, domain, theme_name) + hashtag_search_form += \ + '
\n' + \ + '\n' + hashtag_search_form += '\n' + \ + '
\n' + + # add the page title hashtag_search_form += '
\n' + \ '

#' + \ hashtag + '' else: + # add the page title hashtag_search_form += '
\n' + \ '

#' + hashtag