Show banner on history search screen

merge-requests/30/head
Bob Mottram 2022-09-03 13:50:08 +01:00
parent dbd6fb8290
commit a0f38af3f3
2 changed files with 21 additions and 3 deletions

View File

@ -4081,7 +4081,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cw_lists,
self.server.lists_enabled,
timezone, bold_reading,
self.server.dogwhistles)
self.server.dogwhistles,
self.server.access_keys)
if history_str:
msg = history_str.encode('utf-8')
msglen = len(msg)
@ -4162,7 +4163,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cw_lists,
self.server.lists_enabled,
timezone, bold_reading,
self.server.dogwhistles)
self.server.dogwhistles,
self.server.access_keys)
if bookmarks_str:
msg = bookmarks_str.encode('utf-8')
msglen = len(msg)

View File

@ -655,7 +655,7 @@ def html_history_search(translate: {}, base_dir: str,
cw_lists: {},
lists_enabled: str,
timezone: str, bold_reading: bool,
dogwhistles: {}) -> str:
dogwhistles: {}, access_keys: {}) -> str:
"""Show a page containing search results for your post history
"""
if historysearch.startswith("'"):
@ -683,6 +683,22 @@ def html_history_search(translate: {}, base_dir: str,
if box_name == 'bookmarks':
history_search_title = '🔍 ' + translate['Bookmarks']
if nickname and domain and theme_name:
banner_file, _ = \
get_banner_file(base_dir, nickname, domain, theme_name)
history_search_form += \
'<header>\n' + \
'<a href="/users/' + nickname + '/search" title="' + \
translate['Search and follow'] + '" alt="' + \
translate['Search and follow'] + '" ' + \
'aria-flowto="containerHeader" tabindex="1" accesskey="' + \
access_keys['menuSearch'] + '">\n'
history_search_form += \
'<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header>\n'
history_search_form += \
'<center><h1><a href="' + actor + '/search">' + \
history_search_title + '</a></h1></center>'