Show top banner on access keys screen

main
Bob Mottram 2022-05-14 13:15:26 +01:00
parent 08e42ea453
commit 299461ecd1
2 changed files with 22 additions and 4 deletions

View File

@ -16256,7 +16256,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.translate, self.server.translate,
access_keys, access_keys,
self.server.access_keys, self.server.access_keys,
self.server.default_timeline) self.server.default_timeline,
self.server.theme_name)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._login_headers('text/html', msglen, calling_domain) self._login_headers('text/html', msglen, calling_domain)

View File

@ -14,6 +14,7 @@ from utils import get_config_param
from utils import acct_dir from utils import acct_dir
from webapp_utils import html_header_with_external_style from webapp_utils import html_header_with_external_style
from webapp_utils import html_footer from webapp_utils import html_footer
from webapp_utils import get_banner_file
def load_access_keys_for_accounts(base_dir: str, key_shortcuts: {}, def load_access_keys_for_accounts(base_dir: str, key_shortcuts: {},
@ -43,7 +44,7 @@ def html_access_keys(css_cache: {}, base_dir: str,
nickname: str, domain: str, nickname: str, domain: str,
translate: {}, access_keys: {}, translate: {}, access_keys: {},
default_access_keys: {}, default_access_keys: {},
default_timeline: str) -> str: default_timeline: str, theme: str) -> str:
"""Show and edit key shortcuts """Show and edit key shortcuts
""" """
access_keys_filename = \ access_keys_filename = \
@ -53,6 +54,9 @@ def html_access_keys(css_cache: {}, base_dir: str,
if access_keys_from_file: if access_keys_from_file:
access_keys = access_keys_from_file access_keys = access_keys_from_file
timeline_key = access_keys['menuTimeline']
submit_key = access_keys['submitButton']
access_keys_form = '' access_keys_form = ''
css_filename = base_dir + '/epicyon-profile.css' css_filename = base_dir + '/epicyon-profile.css'
if os.path.isfile(base_dir + '/epicyon.css'): if os.path.isfile(base_dir + '/epicyon.css'):
@ -62,6 +66,21 @@ def html_access_keys(css_cache: {}, base_dir: str,
get_config_param(base_dir, 'instanceTitle') get_config_param(base_dir, 'instanceTitle')
access_keys_form = \ access_keys_form = \
html_header_with_external_style(css_filename, instance_title, None) html_header_with_external_style(css_filename, instance_title, None)
access_keys_form += \
'<header>\n' + \
'<a href="/users/' + nickname + '/' + \
default_timeline + '" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + timeline_key + '">\n'
banner_file, _ = \
get_banner_file(base_dir, nickname, domain, theme)
access_keys_form += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header>\n'
access_keys_form += '<div class="container">\n' access_keys_form += '<div class="container">\n'
access_keys_form += \ access_keys_form += \
@ -73,8 +92,6 @@ def html_access_keys(css_cache: {}, base_dir: str,
access_keys_form += ' <form method="POST" action="' + \ access_keys_form += ' <form method="POST" action="' + \
'/users/' + nickname + '/changeAccessKeys">\n' '/users/' + nickname + '/changeAccessKeys">\n'
timeline_key = access_keys['menuTimeline']
submit_key = access_keys['submitButton']
access_keys_form += \ access_keys_form += \
' <center>\n' + \ ' <center>\n' + \
' <button type="submit" class="button" ' + \ ' <button type="submit" class="button" ' + \