From 299461ecd159d1f4c0531a7c8cedbe3a3bd90358 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 May 2022 13:15:26 +0100 Subject: [PATCH] Show top banner on access keys screen --- daemon.py | 3 ++- webapp_accesskeys.py | 23 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index e56b8ee14..f43b38807 100644 --- a/daemon.py +++ b/daemon.py @@ -16256,7 +16256,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.translate, access_keys, self.server.access_keys, - self.server.default_timeline) + self.server.default_timeline, + self.server.theme_name) msg = msg.encode('utf-8') msglen = len(msg) self._login_headers('text/html', msglen, calling_domain) diff --git a/webapp_accesskeys.py b/webapp_accesskeys.py index 3d206f378..f53388321 100644 --- a/webapp_accesskeys.py +++ b/webapp_accesskeys.py @@ -14,6 +14,7 @@ from utils import get_config_param from utils import acct_dir from webapp_utils import html_header_with_external_style from webapp_utils import html_footer +from webapp_utils import get_banner_file 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, translate: {}, access_keys: {}, default_access_keys: {}, - default_timeline: str) -> str: + default_timeline: str, theme: str) -> str: """Show and edit key shortcuts """ access_keys_filename = \ @@ -53,6 +54,9 @@ def html_access_keys(css_cache: {}, base_dir: str, if access_keys_from_file: access_keys = access_keys_from_file + timeline_key = access_keys['menuTimeline'] + submit_key = access_keys['submitButton'] + access_keys_form = '' css_filename = base_dir + '/epicyon-profile.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') access_keys_form = \ html_header_with_external_style(css_filename, instance_title, None) + + access_keys_form += \ + '
\n' + \ + '\n' + banner_file, _ = \ + get_banner_file(base_dir, nickname, domain, theme) + access_keys_form += '\n' + \ + '
\n' + access_keys_form += '
\n' access_keys_form += \ @@ -73,8 +92,6 @@ def html_access_keys(css_cache: {}, base_dir: str, access_keys_form += '
\n' - timeline_key = access_keys['menuTimeline'] - submit_key = access_keys['submitButton'] access_keys_form += \ '
\n' + \ '