From 9538f287577451a7e283ef4e5568327a33829a0b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 10 Jul 2025 18:21:30 +0100 Subject: [PATCH] Remove icons_as_buttons option It adds too much complexity to user interface implementation --- daemon.py | 5 - daemon_get.py | 24 ----- daemon_get_feeds.py | 10 -- daemon_get_profile.py | 6 -- daemon_get_timeline.py | 24 ----- daemon_post_profile.py | 2 - epicyon.py | 8 -- tests.py | 8 +- theme.py | 20 ---- webapp_column_left.py | 4 +- webapp_column_right.py | 4 +- webapp_frontscreen.py | 4 +- webapp_headerbuttons.py | 209 +++++++++++++--------------------------- webapp_moderation.py | 3 +- webapp_profile.py | 2 - webapp_timeline.py | 179 ++++++++++++---------------------- webapp_utils.py | 45 +++------ 17 files changed, 148 insertions(+), 409 deletions(-) diff --git a/daemon.py b/daemon.py index abee985c8..485bc1da8 100644 --- a/daemon.py +++ b/daemon.py @@ -384,7 +384,6 @@ class EpicyonServer(ThreadingHTTPServer): max_followers = 2000 show_publish_as_icon = False full_width_tl_button_header = False - icons_as_buttons = False rss_icon_at_top = True publish_button_at_top = False max_feed_item_size_kb = 100 @@ -619,7 +618,6 @@ def run_daemon(accounts_data_dir: str, max_feed_item_size_kb: int, publish_button_at_top: bool, rss_icon_at_top: bool, - icons_as_buttons: bool, full_width_tl_button_header: bool, show_publish_as_icon: bool, max_followers: int, @@ -1076,9 +1074,6 @@ def run_daemon(accounts_data_dir: str, # calendar, etc as the full width of the screen or not httpd.full_width_tl_button_header = full_width_tl_button_header - # whether to show icons in the header (eg calendar) as buttons - httpd.icons_as_buttons = False - # whether to show the RSS icon at the top or the bottom of the timeline httpd.rss_icon_at_top = rss_icon_at_top diff --git a/daemon_get.py b/daemon_get.py index 33c4efe42..2fae6a0f7 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -2981,7 +2981,6 @@ def daemon_http_get(self) -> None: '/users/' + nickname + '/' + self.server.default_timeline show_publish_as_icon = self.server.show_publish_as_icon rss_icon_at_top = self.server.rss_icon_at_top - icons_as_buttons = False default_timeline = self.server.default_timeline access_keys = self.server.access_keys if self.server.key_shortcuts.get(nickname): @@ -2998,7 +2997,6 @@ def daemon_http_get(self) -> None: show_publish_as_icon, authorized, rss_icon_at_top, - icons_as_buttons, default_timeline, self.server.theme_name, access_keys, @@ -3026,7 +3024,6 @@ def daemon_http_get(self) -> None: access_keys = self.server.key_shortcuts[nickname] timeline_path = \ '/users/' + nickname + '/' + self.server.default_timeline - icons_as_buttons = False default_timeline = self.server.default_timeline shared_items_domains = \ self.server.shared_items_federated_domains @@ -3039,7 +3036,6 @@ def daemon_http_get(self) -> None: timeline_path, authorized, self.server.rss_icon_at_top, - icons_as_buttons, default_timeline, self.server.theme_name, access_keys, @@ -4720,7 +4716,6 @@ def daemon_http_get(self) -> None: self.server.cached_webfingers, self.server.yt_replace_domain, self.server.twitter_replacement_domain, - self.server.icons_as_buttons, self.server.access_keys, self.server.key_shortcuts, self.server.city, @@ -4779,7 +4774,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.twitter_replacement_domain, self.server.show_published_date_only, - self.server.icons_as_buttons, self.server.allow_local_network_access, self.server.access_keys, self.server.key_shortcuts, @@ -4951,7 +4945,6 @@ def daemon_http_get(self) -> None: self.server.show_published_date_only, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5012,7 +5005,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5073,7 +5065,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5134,7 +5125,6 @@ def daemon_http_get(self) -> None: self.server.show_published_date_only, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5198,7 +5188,6 @@ def daemon_http_get(self) -> None: self.server.show_published_date_only, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5260,7 +5249,6 @@ def daemon_http_get(self) -> None: self.server.show_published_date_only, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5322,7 +5310,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5379,7 +5366,6 @@ def daemon_http_get(self) -> None: self.server.newswire, self.server.positive_voting, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5433,7 +5419,6 @@ def daemon_http_get(self) -> None: self.server.newswire, self.server.positive_voting, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5586,7 +5571,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5648,7 +5632,6 @@ def daemon_http_get(self) -> None: self.server.show_published_date_only, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5715,7 +5698,6 @@ def daemon_http_get(self) -> None: self.server.yt_replace_domain, self.server.newswire, self.server.show_publish_as_icon, - self.server.icons_as_buttons, self.server.rss_icon_at_top, self.server.publish_button_at_top, self.server.theme_name, @@ -5759,7 +5741,6 @@ def daemon_http_get(self) -> None: self.server.bold_reading, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -5821,7 +5802,6 @@ def daemon_http_get(self) -> None: self.server.sites_unavailable, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -5879,7 +5859,6 @@ def daemon_http_get(self) -> None: self.server.sites_unavailable, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -5939,7 +5918,6 @@ def daemon_http_get(self) -> None: self.server.max_shares_on_profile, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -5997,7 +5975,6 @@ def daemon_http_get(self) -> None: self.server.sites_unavailable, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -6056,7 +6033,6 @@ def daemon_http_get(self) -> None: self.server.fitness, self.server.signing_priv_key_pem, self.server.rss_icon_at_top, - self.server.icons_as_buttons, self.server.default_timeline, self.server.recent_posts_cache, self.server.max_recent_posts, diff --git a/daemon_get_feeds.py b/daemon_get_feeds.py index 98a1ce20c..3e387e568 100644 --- a/daemon_get_feeds.py +++ b/daemon_get_feeds.py @@ -40,7 +40,6 @@ def show_shares_feed(self, authorized: bool, bold_reading_nicknames: {}, signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -135,7 +134,6 @@ def show_shares_feed(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -232,7 +230,6 @@ def show_following_feed(self, authorized: bool, sites_unavailable: [], signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -330,7 +327,6 @@ def show_following_feed(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -434,7 +430,6 @@ def show_moved_feed(self, authorized: bool, sites_unavailable: [], signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -527,7 +522,6 @@ def show_moved_feed(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -624,7 +618,6 @@ def show_inactive_feed(self, authorized: bool, max_shares_on_profile: int, signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -717,7 +710,6 @@ def show_inactive_feed(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -815,7 +807,6 @@ def show_followers_feed(self, authorized: bool, sites_unavailable: [], signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -909,7 +900,6 @@ def show_followers_feed(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, diff --git a/daemon_get_profile.py b/daemon_get_profile.py index 18ab59a94..9fd7eb9ce 100644 --- a/daemon_get_profile.py +++ b/daemon_get_profile.py @@ -55,7 +55,6 @@ def show_person_profile(self, authorized: bool, fitness: {}, signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, @@ -121,7 +120,6 @@ def show_person_profile(self, authorized: bool, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -216,7 +214,6 @@ def show_roles(self, calling_domain: str, referer_domain: str, cached_webfingers: {}, yt_replace_domain: str, twitter_replacement_domain: str, - icons_as_buttons: bool, access_keys: {}, key_shortcuts: {}, city: str, signing_priv_key_pem: str, @@ -291,7 +288,6 @@ def show_roles(self, calling_domain: str, referer_domain: str, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, @@ -373,7 +369,6 @@ def show_skills(self, calling_domain: str, referer_domain: str, yt_replace_domain: str, twitter_replacement_domain: str, show_published_date_only: bool, - icons_as_buttons: bool, allow_local_network_access: bool, access_keys: {}, key_shortcuts: {}, @@ -448,7 +443,6 @@ def show_skills(self, calling_domain: str, referer_domain: str, msg = \ html_profile(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, diff --git a/daemon_get_timeline.py b/daemon_get_timeline.py index 3ae5dcd22..ed8531c32 100644 --- a/daemon_get_timeline.py +++ b/daemon_get_timeline.py @@ -66,7 +66,6 @@ def show_media_timeline(self, authorized: bool, show_published_date_only: bool, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -183,7 +182,6 @@ def show_media_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -286,7 +284,6 @@ def show_blogs_timeline(self, authorized: bool, show_published_date_only: bool, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -398,7 +395,6 @@ def show_blogs_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -499,7 +495,6 @@ def show_news_timeline(self, authorized: bool, show_published_date_only: bool, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -617,7 +612,6 @@ def show_news_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -718,7 +712,6 @@ def show_features_timeline(self, authorized: bool, yt_replace_domain: str, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -830,7 +823,6 @@ def show_features_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -927,7 +919,6 @@ def show_shares_timeline(self, authorized: bool, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1004,7 +995,6 @@ def show_shares_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, theme_name, @@ -1077,7 +1067,6 @@ def show_wanted_timeline(self, authorized: bool, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1153,7 +1142,6 @@ def show_wanted_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, theme_name, @@ -1230,7 +1218,6 @@ def show_bookmarks_timeline(self, authorized: bool, yt_replace_domain: str, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1337,7 +1324,6 @@ def show_bookmarks_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -1438,7 +1424,6 @@ def show_outbox_timeline(self, authorized: bool, show_published_date_only: bool, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1557,7 +1542,6 @@ def show_outbox_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, @@ -1648,7 +1632,6 @@ def show_mod_timeline(self, authorized: bool, yt_replace_domain: str, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1752,7 +1735,6 @@ def show_mod_timeline(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, moderation_action_str, @@ -1852,7 +1834,6 @@ def show_dms(self, authorized: bool, yt_replace_domain: str, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -1963,7 +1944,6 @@ def show_dms(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, theme_name, @@ -2064,7 +2044,6 @@ def show_replies(self, authorized: bool, yt_replace_domain: str, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -2175,7 +2154,6 @@ def show_replies(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, theme_name, @@ -2277,7 +2255,6 @@ def show_inbox(self, authorized: bool, show_published_date_only: bool, newswire: {}, show_publish_as_icon: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, theme_name: str, @@ -2399,7 +2376,6 @@ def show_inbox(self, authorized: bool, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, publish_button_at_top, authorized, diff --git a/daemon_post_profile.py b/daemon_post_profile.py index 2fd46268a..f72467c9a 100644 --- a/daemon_post_profile.py +++ b/daemon_post_profile.py @@ -1444,7 +1444,6 @@ def _profile_post_remove_custom_font(base_dir: str, nickname: str, domain: str, get_config_param(base_dir, 'showPublishAsIcon') self.server.full_width_tl_button_header = \ get_config_param(base_dir, 'fullWidthTimelineButtonHeader') - self.server.icons_as_buttons = False self.server.rss_icon_at_top = \ get_config_param(base_dir, 'rssIconAtTop') self.server.publish_button_at_top = \ @@ -2616,7 +2615,6 @@ def _profile_post_theme_change(base_dir: str, nickname: str, get_config_param(base_dir, 'showPublishAsIcon') self.server.full_width_tl_button_header = \ get_config_param(base_dir, 'fullWidthTlButtonHeader') - self.server.icons_as_buttons = False self.server.rss_icon_at_top = \ get_config_param(base_dir, 'rssIconAtTop') self.server.publish_button_at_top = \ diff --git a/epicyon.py b/epicyon.py index 73d583254..ec7dcc0dd 100644 --- a/epicyon.py +++ b/epicyon.py @@ -525,11 +525,6 @@ def _command_options() -> None: help="Whether to show the timeline " + "button header containing inbox and outbox " + "as the full width of the screen") - parser.add_argument("--icons_as_buttons", - dest='icons_as_buttons', - type=str2bool, nargs='?', - const=True, default=False, - help="Show header icons as buttons") parser.add_argument("--log_login_failures", dest='log_login_failures', type=str2bool, nargs='?', @@ -4159,8 +4154,6 @@ def _command_options() -> None: if show_publish_as_icon is not None: argb.show_publish_as_icon = bool(show_publish_as_icon) - icons_as_buttons = False - rss_icon_at_top = \ get_config_param(base_dir, 'rssIconAtTop') if rss_icon_at_top is not None: @@ -4353,7 +4346,6 @@ if __name__ == "__main__": argb2.max_feed_item_size_kb, argb2.publish_button_at_top, argb2.rss_icon_at_top, - argb2.icons_as_buttons, argb2.full_width_tl_button_header, argb2.show_publish_as_icon, argb2.max_followers, diff --git a/tests.py b/tests.py index aa8842092..f16f442d0 100644 --- a/tests.py +++ b/tests.py @@ -938,7 +938,7 @@ def create_server_alice(path: str, domain: str, port: int, send_threads_timeout_mins, dormant_months, max_newswire_posts, allow_local_network_access, - 2048, False, True, False, False, True, max_followers, + 2048, False, True, False, True, max_followers, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, @@ -1139,7 +1139,7 @@ def create_server_bob(path: str, domain: str, port: int, send_threads_timeout_mins, dormant_months, max_newswire_posts, allow_local_network_access, - 2048, False, True, False, False, True, max_followers, + 2048, False, True, False, True, max_followers, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, @@ -1245,7 +1245,7 @@ def create_server_eve(path: str, domain: str, port: int, federation_list: [], dormant_months, max_newswire_posts, allow_local_network_access, - 2048, False, True, False, False, True, + 2048, False, True, False, True, max_followers, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, @@ -1361,7 +1361,7 @@ def create_server_group(path: str, domain: str, port: int, send_threads_timeout_mins, dormant_months, max_newswire_posts, allow_local_network_access, - 2048, False, True, False, False, True, max_followers, + 2048, False, True, False, True, max_followers, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, diff --git a/theme.py b/theme.py index 8d6530607..45b84e70e 100644 --- a/theme.py +++ b/theme.py @@ -205,20 +205,6 @@ def _set_newswire_publish_as_icon(base_dir: str, use_icon: bool) -> bool: return save_json(config_json, config_filename) -def _set_icons_as_buttons(base_dir: str, use_buttons: bool) -> bool: - """Whether to show icons in the header (inbox, outbox, etc) - as buttons - """ - config_filename = base_dir + '/config.json' - if not os.path.isfile(config_filename): - return False - config_json = load_json(config_filename) - if not config_json: - return False - config_json['iconsAsButtons'] = use_buttons - return save_json(config_json, config_filename) - - def _set_rss_icon_at_top(base_dir: str, at_top: bool) -> bool: """Whether to show RSS icon at the top of the timeline """ @@ -383,12 +369,6 @@ def _set_theme_from_dict(base_dir: str, name: str, else: _set_full_width_timeline_button_header(base_dir, False) continue - if param_name == 'icons-as-buttons': - if param_value.lower() == 'true': - _set_icons_as_buttons(base_dir, True) - else: - _set_icons_as_buttons(base_dir, False) - continue if param_name == 'rss-icon-at-top': if param_value.lower() == 'true': _set_rss_icon_at_top(base_dir, True) diff --git a/webapp_column_left.py b/webapp_column_left.py index 9da4c14bc..ed3a782fd 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -378,7 +378,6 @@ def html_links_mobile(base_dir: str, http_prefix: str, translate, timeline_path: str, authorized: bool, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, theme: str, access_keys: {}, shared_items_federated_domains: [], @@ -420,8 +419,7 @@ def html_links_mobile(base_dir: str, html_str += '
\n' html_str += '
' + \ header_buttons_front_screen(translate, nickname, - 'links', authorized, - icons_as_buttons) + '
' + 'links', authorized) + '' html_str += \ get_left_column_content(base_dir, nickname, domain_full, http_prefix, translate, diff --git a/webapp_column_right.py b/webapp_column_right.py index 3cc5e7e4c..5d3164d5b 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -496,7 +496,6 @@ def html_newswire_mobile(base_dir: str, nickname: str, show_publish_as_icon: bool, authorized: bool, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, theme: str, access_keys: {}, @@ -546,8 +545,7 @@ def html_newswire_mobile(base_dir: str, nickname: str, html_str += '
' + \ header_buttons_front_screen(translate, nickname, - 'newswire', authorized, - icons_as_buttons) + '
' + 'newswire', authorized) + '' html_str += \ get_right_column_content(base_dir, nickname, domain_full, translate, diff --git a/webapp_frontscreen.py b/webapp_frontscreen.py index 7c06577d6..ccbb87044 100644 --- a/webapp_frontscreen.py +++ b/webapp_frontscreen.py @@ -115,7 +115,6 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int, def html_front_screen(signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, translate: {}, project_version: str, @@ -155,8 +154,7 @@ def html_front_screen(signing_priv_key_pem: str, domain_full = domain + ':' + str(port) login_button = header_buttons_front_screen(translate, nickname, - 'features', authorized, - icons_as_buttons) + 'features', authorized) # If this is the news account then show a different banner banner_file, _ = \ diff --git a/webapp_headerbuttons.py b/webapp_headerbuttons.py index b68c5a5c6..67ae435f1 100644 --- a/webapp_headerbuttons.py +++ b/webapp_headerbuttons.py @@ -46,7 +46,6 @@ def header_buttons_timeline(default_timeline: str, calendar_path: str, calendar_image: str, follow_approvals: str, - icons_as_buttons: bool, access_keys: {}, is_text_browser: str, show_announces: bool) -> str: @@ -205,50 +204,27 @@ def header_buttons_timeline(default_timeline: str, twodays = datetime.now() + timedelta(2) if day_events_check(base_dir, nickname, domain, now): # happening today button - if not icons_as_buttons: - happening_str += \ - '' + \ - '' - else: - happening_str += \ - '' + \ - '' + happening_str += \ + '' + \ + '' elif day_events_check(base_dir, nickname, domain, tomorrow): # happening tomorrow button - if not icons_as_buttons: - happening_str += \ - '' + \ - '' - else: - happening_str += \ - '' + \ - '' + happening_str += \ + '' + \ + '' elif day_events_check(base_dir, nickname, domain, twodays): - if not icons_as_buttons: - happening_str += \ - '' + \ - '' - else: - happening_str += \ - '' + \ - '' + happening_str += \ + '' + \ + '' if not is_text_browser: if not features_header: @@ -290,59 +266,34 @@ def header_buttons_timeline(default_timeline: str, # 3. the newswire and links button to show right column links if not is_text_browser: # the links button to show left column links - if not icons_as_buttons: - tl_str += \ - '' + \ - '| ' + translate['Edit Links'] + \
-                '' - else: - # NOTE: deliberately no \n at end of line - tl_str += \ - '' + tl_str += \ + '' + \ + '| ' + translate['Edit Links'] + \
+            '' # the newswire button to show left column links - if not icons_as_buttons: - tl_str += \ - '' + \ - '| ' + translate['News'] + \
-                '' - else: - # NOTE: deliberately no \n at end of line - tl_str += \ - '' + tl_str += \ + '' + \ + '| ' + translate['News'] + \
+            '' if not is_text_browser: if not features_header: # 4. the show/hide button, for a simpler header appearance - if not icons_as_buttons: - tl_str += \ - ' ' + \ - '| ' + translate['Show/Hide Buttons'] + \
-                    '\n' - else: - tl_str += \ - '' + tl_str += \ + ' ' + \ + '| ' + translate['Show/Hide Buttons'] + \
+                '\n' # 5. the hide announces button if show_announces: @@ -352,21 +303,14 @@ def header_buttons_timeline(default_timeline: str, hide_announces_icon = 'repeat_show.png' hide_announces_text = translate['Show Announces'] - if not icons_as_buttons: - tl_str += \ - ' ' + \ - '| ' + translate['Hide Announces'] + \
-                    '\n' - else: - tl_str += \ - '' + tl_str += \ + ' ' + \ + '| ' + translate['Hide Announces'] + \
+                '\n' # 6. calendar button if not features_header: @@ -374,23 +318,15 @@ def header_buttons_timeline(default_timeline: str, if new_calendar_event: # indicate that the calendar icon is highlighted calendar_alt_text = '*' + calendar_alt_text + '*' - if not icons_as_buttons: - tl_str += \ - ' ' + \ - '| ' + calendar_alt_text + \
-                    '\n' - else: - tl_str += \ - '' + tl_str += \ + ' ' + \ + '| ' + calendar_alt_text + \
+                '\n' if features_header: tl_str += \ @@ -404,26 +340,16 @@ def header_buttons_timeline(default_timeline: str, # 7. search button if not is_text_browser: if not features_header: - if not icons_as_buttons: - # the search icon - tl_str += \ - '' + \ - '| ' + \
-                    translate['Search and follow'] + \
-                    '' - else: - # the search button - tl_str += \ - '' + \ - '
' + tl_str += '' # end of the button header with inbox, outbox, etc tl_str += ' \n' diff --git a/webapp_moderation.py b/webapp_moderation.py index 059a2f86b..6dfd55367 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -49,7 +49,6 @@ def html_moderation(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, moderation_action_str: str, @@ -89,7 +88,7 @@ def html_moderation(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, moderation_action_str, theme, peertube_instances, allow_local_network_access, diff --git a/webapp_profile.py b/webapp_profile.py index 3cc0d242d..c1a4b913d 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1063,7 +1063,6 @@ def _get_profile_header_after_search(base_dir: str, def html_profile(signing_priv_key_pem: str, rss_icon_at_top: bool, - icons_as_buttons: bool, default_timeline: str, recent_posts_cache: {}, max_recent_posts: int, translate: {}, project_version: str, @@ -1110,7 +1109,6 @@ def html_profile(signing_priv_key_pem: str, min_images_for_accounts: list[str] = [] return html_front_screen(signing_priv_key_pem, rss_icon_at_top, - icons_as_buttons, default_timeline, recent_posts_cache, max_recent_posts, translate, project_version, diff --git a/webapp_timeline.py b/webapp_timeline.py index 6d96bfc14..96702c198 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -113,118 +113,72 @@ def _get_help_for_timeline(base_dir: str, box_name: str) -> str: def _html_timeline_new_post(manually_approve_followers: bool, - box_name: str, icons_as_buttons: bool, + box_name: str, users_path: str, translate: {}, access_keys: {}) -> str: """Returns html for the new post button """ new_post_button_str = '' if box_name == 'dm': - if not icons_as_buttons: - new_post_button_str += \ - '' + \ - '| ' + translate['Create a new DM'] + \
-                '\n' - else: - new_post_button_str += \ - '' + \ - '' + new_post_button_str += \ + '' + \ + '| ' + translate['Create a new DM'] + \
+            '\n' elif box_name in ('tlblogs', 'tlnews', 'tlfeatures'): - if not icons_as_buttons: + new_post_button_str += \ + '' + \ + '| ' + \
+            translate['Create a new post'] + \
+            '\n' + elif box_name == 'tlshares': + new_post_button_str += \ + '' + \ + '| ' + \
+            translate['Create a new shared item'] + \
+            '\n' + elif box_name == 'tlwanted': + new_post_button_str += \ + '' + \ + '| ' + \
+            translate['Create a new wanted item'] + \
+            '\n' + else: + if not manually_approve_followers: new_post_button_str += \ '' + \ + '/newpost" tabindex="3">' + \ '| ' + \
                 translate['Create a new post'] + \
                 '\n' else: - new_post_button_str += \ - '' + \ - '' - elif box_name == 'tlshares': - if not icons_as_buttons: new_post_button_str += \ '' + \ '| ' + \
-                translate['Create a new shared item'] + \
+                translate['Create a new post'] + \
+                '\n' - else: - new_post_button_str += \ - '' + \ - '' - elif box_name == 'tlwanted': - if not icons_as_buttons: - new_post_button_str += \ - '' + \ - '| ' + \
-                translate['Create a new wanted item'] + \
-                '\n' - else: - new_post_button_str += \ - '' + \ - '' - else: - if not manually_approve_followers: - if not icons_as_buttons: - new_post_button_str += \ - '' + \ - '| ' + \
-                    translate['Create a new post'] + \
-                    '\n' - else: - new_post_button_str += \ - '' + \ - '' - else: - if not icons_as_buttons: - new_post_button_str += \ - '' + \ - '| ' + translate['Create a new post'] + \
-                    '\n' - else: - new_post_button_str += \ - '' + \ - '' return new_post_button_str @@ -502,7 +456,6 @@ def html_timeline(default_timeline: str, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, @@ -823,13 +776,12 @@ def html_timeline(default_timeline: str, header_icons_str = '' # start of headericons div if not news_header: - if not icons_as_buttons: - header_icons_str = '
' + header_icons_str = '
' # what screen to go to when a new post is created new_post_button_str = \ _html_timeline_new_post(manually_approve_followers, box_name, - icons_as_buttons, users_path, translate, + users_path, translate, access_keys) # keyboard navigation @@ -870,7 +822,7 @@ def html_timeline(default_timeline: str, domain, timeline_start_time, new_calendar_event, calendar_path, calendar_image, follow_approvals, - icons_as_buttons, access_keys, + access_keys, is_text_browser, show_announces) # start the timeline @@ -924,7 +876,7 @@ def html_timeline(default_timeline: str, domain, timeline_start_time, new_calendar_event, calendar_path, calendar_image, follow_approvals, - icons_as_buttons, access_keys, + access_keys, is_text_browser, show_announces) tl_str += \ @@ -1410,7 +1362,6 @@ def html_shares(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1454,7 +1405,7 @@ def html_shares(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1484,7 +1435,6 @@ def html_wanted(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1528,7 +1478,7 @@ def html_wanted(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1559,7 +1509,6 @@ def html_inbox(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1604,7 +1553,7 @@ def html_inbox(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1635,7 +1584,6 @@ def html_bookmarks(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1679,7 +1627,7 @@ def html_bookmarks(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1709,7 +1657,6 @@ def html_inbox_dms(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1749,7 +1696,7 @@ def html_inbox_dms(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1780,7 +1727,6 @@ def html_inbox_replies(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1820,7 +1766,7 @@ def html_inbox_replies(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1849,7 +1795,6 @@ def html_inbox_media(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1889,7 +1834,7 @@ def html_inbox_media(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1918,7 +1863,6 @@ def html_inbox_blogs(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -1958,7 +1902,7 @@ def html_inbox_blogs(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -1987,7 +1931,6 @@ def html_inbox_features(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, @@ -2026,7 +1969,7 @@ def html_inbox_features(default_timeline: str, newswire, False, False, False, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -2055,7 +1998,6 @@ def html_inbox_news(default_timeline: str, newswire: {}, moderator: bool, editor: bool, artist: bool, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -2093,7 +2035,7 @@ def html_inbox_news(default_timeline: str, newswire, moderator, editor, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, @@ -2122,7 +2064,6 @@ def html_outbox(default_timeline: str, newswire: {}, positive_voting: bool, show_publish_as_icon: bool, full_width_tl_button_header: bool, - icons_as_buttons: bool, rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, @@ -2163,7 +2104,7 @@ def html_outbox(default_timeline: str, newswire, False, False, artist, positive_voting, show_publish_as_icon, full_width_tl_button_header, - icons_as_buttons, rss_icon_at_top, + rss_icon_at_top, publish_button_at_top, authorized, None, theme, peertube_instances, allow_local_network_access, text_mode_banner, diff --git a/webapp_utils.py b/webapp_utils.py index 744a5e778..a78252f27 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -213,21 +213,14 @@ def html_hashtag_blocked(base_dir: str, translate: {}) -> str: def header_buttons_front_screen(translate: {}, nickname: str, box_name: str, - authorized: bool, - icons_as_buttons: bool) -> str: + authorized: bool) -> str: """Returns the header buttons for the front page of a news instance """ header_str = '' if nickname == 'news': button_features = 'buttonMobile' - button_newswire = 'buttonMobile' - button_links = 'buttonMobile' if box_name == 'features': button_features = 'buttonselected' - elif box_name == 'newswire': - button_newswire = 'buttonselected' - elif box_name == 'links': - button_links = 'buttonselected' header_str += \ ' ' + \ @@ -240,30 +233,18 @@ def header_buttons_front_screen(translate: {}, '' - if icons_as_buttons: - header_str += \ - ' ' + \ - '' - header_str += \ - ' ' + \ - '' - else: - header_str += \ - ' ' + \ - '| ' + translate['Newswire'] + '\n' - header_str += \ - ' ' + \ - '| ' + translate['Links'] + '\n' + header_str += \ + ' ' + \ + '| ' + translate['Newswire'] + '\n' + header_str += \ + ' ' + \ + '| ' + translate['Links'] + '\n' else: if not authorized: header_str += \