From 9ff712a039c53e97a009a026a2fd96b214b68f22 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 15 Jan 2023 15:05:48 +0000 Subject: [PATCH] Banner on block confirm screen --- daemon.py | 6 +++++- webapp_confirm.py | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index b72fa6984..965275ea1 100644 --- a/daemon.py +++ b/daemon.py @@ -3589,7 +3589,11 @@ class PubServer(BaseHTTPRequestHandler): base_dir, users_path, options_actor, - options_avatar_url).encode('utf-8') + options_avatar_url, + chooser_nickname, + domain, self.server.theme_name, + self.server.default_timeline, + self.server.access_keys).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) diff --git a/webapp_confirm.py b/webapp_confirm.py index a0faa827d..492e95fd6 100644 --- a/webapp_confirm.py +++ b/webapp_confirm.py @@ -18,6 +18,7 @@ from utils import get_config_param from utils import get_alt_path from utils import acct_dir from utils import get_account_timezone +from webapp_utils import get_banner_file from webapp_utils import set_custom_background from webapp_utils import html_header_with_external_style from webapp_utils import html_footer @@ -350,13 +351,19 @@ def html_confirm_unblock(translate: {}, base_dir: str, def html_confirm_block(translate: {}, base_dir: str, origin_path_str: str, block_actor: str, - block_profile_url: str) -> str: + block_profile_url: str, + nickname: str, domain: str, theme: str, + default_timeline: str, + access_keys: {}) -> str: """Asks to confirm blocking an actor """ block_domain, _ = get_domain_from_actor(block_actor) set_custom_background(base_dir, 'block-background', 'follow-background') + banner_file, _ = \ + get_banner_file(base_dir, nickname, domain, theme) + css_filename = base_dir + '/epicyon-follow.css' if os.path.isfile(base_dir + '/follow.css'): css_filename = base_dir + '/follow.css' @@ -364,6 +371,20 @@ def html_confirm_block(translate: {}, base_dir: str, instance_title = get_config_param(base_dir, 'instanceTitle') block_str = html_header_with_external_style(css_filename, instance_title, None) + + block_str += \ + '
\n' + \ + '\n' + block_str += '\n' + \ + '
\n' + block_str += '
\n' block_str += '
\n' block_str += '
\n'