From 132303b04f94f4ac18d884d47218a54cfcbd6e22 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 20 Jun 2024 12:44:13 +0100 Subject: [PATCH] Add banner to conversation view so that it's easier to go back to the timeline using keyboard navigation --- daemon_get.py | 3 ++- daemon_get_post.py | 6 ++++-- webapp_conversation.py | 20 +++++++++++++++++++- webapp_timeline.py | 2 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/daemon_get.py b/daemon_get.py index e5ee46285..d093c9a75 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -625,7 +625,8 @@ def daemon_http_get(self) -> None: self.server.buy_sites, self.server.blocked_cache, self.server.block_federated, - self.server.auto_cw_cache): + self.server.auto_cw_cache, + self.server.default_timeline): fitness_performance(getreq_start_time, self.server.fitness, '_GET', '_show_conversation_thread', self.server.debug) diff --git a/daemon_get_post.py b/daemon_get_post.py index 7d0159a64..c9c3a681b 100644 --- a/daemon_get_post.py +++ b/daemon_get_post.py @@ -1273,7 +1273,8 @@ def show_conversation_thread(self, authorized: bool, buy_sites: [], blocked_cache: {}, block_federated: {}, - auto_cw_cache: {}) -> bool: + auto_cw_cache: {}, + default_timeline: str) -> bool: """get conversation thread from the date link on a post """ if not path.startswith('/users/'): @@ -1334,7 +1335,8 @@ def show_conversation_thread(self, authorized: bool, blocked_cache, block_federated, auto_cw_cache, - ua_str) + ua_str, + default_timeline) if conv_str: msg = conv_str.encode('utf-8') msglen = len(msg) diff --git a/webapp_conversation.py b/webapp_conversation.py index 9c4167be1..dd9ce0604 100644 --- a/webapp_conversation.py +++ b/webapp_conversation.py @@ -21,6 +21,7 @@ from webapp_utils import text_mode_browser from webapp_utils import html_header_with_external_style from webapp_utils import html_post_separator from webapp_utils import html_footer +from webapp_utils import get_banner_file from webapp_post import individual_post_as_html @@ -53,7 +54,8 @@ def html_conversation_view(authorized: bool, post_id: str, blocked_cache: [], block_federated: [], auto_cw_cache: {}, - ua_str: str) -> str: + ua_str: str, + default_timeline: str) -> str: """Show a page containing a conversation thread """ conv_posts = \ @@ -74,6 +76,22 @@ def html_conversation_view(authorized: bool, post_id: str, conv_str = \ html_header_with_external_style(css_filename, instance_title, None) + # banner and row of buttons + users_path = '/users/' + nickname + banner_file, _ = get_banner_file(base_dir, nickname, domain, theme_name) + conv_str += \ + '
\n' + \ + ' \n' + conv_str += '\n' + \ + '
\n' + separator_str = html_post_separator(base_dir, None) text_mode_separator = '

\n' diff --git a/webapp_timeline.py b/webapp_timeline.py index 5530e975d..7b4cf4636 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -793,7 +793,7 @@ def html_timeline(default_timeline: str, # banner and row of buttons tl_str += \ '
\n' + \ - '