From 60c3e4fdbfe2cf9579dcf68f64ba92ff25cb0ff0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 May 2022 11:21:57 +0100 Subject: [PATCH 1/9] Semantic markup for posts --- webapp_post.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 4716c3a11..4e989b8c6 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1025,7 +1025,9 @@ def _announce_with_display_name_html(translate: {}, 'icons/repeat_inactive.png" ' + \ 'class="announceOrReply"/>\n' + \ ' ' + announce_display_name + '\n' + 'class="announceOrReply">' + \ + '\n' def _get_post_title_announce_html(base_dir: str, @@ -1210,7 +1212,8 @@ def _get_reply_html(translate: {}, 'class="announceOrReply"/>\n' + \ ' ' + \ - reply_display_name + '\n' + '' + \ + reply_display_name + '\n' def _get_post_title_reply_html(base_dir: str, @@ -1419,11 +1422,13 @@ def _get_footer_with_icons(show_icons: bool, footer_str += delete_str + mute_str + edit_str if not is_news_post(post_json_object): footer_str += ' ' + published_str + '\n' + time_class + '">' + \ + published_str + '\n' else: footer_str += ' ' + published_str + '\n' + '" class="' + time_class + '">' + \ + published_str + '\n' footer_str += ' \n' footer_str += ' \n' return footer_str @@ -1718,7 +1723,9 @@ def individual_post_as_html(signing_priv_key_pem: str, ' ' + display_name + '\n' + '">' + \ + '' + display_name + '' + \ + '\n' else: if not message_id: # pprint(post_json_object) @@ -1729,11 +1736,12 @@ def individual_post_as_html(signing_priv_key_pem: str, if not actor_domain: # pprint(post_json_object) print('ERROR: no actor_domain') + actor_handle = actor_nickname + '@' + actor_domain title_str += \ ' @' + actor_nickname + '@' + actor_domain + '\n' + '">@' + actor_handle + '\n' # benchmark 9 _log_post_timing(enable_timing_log, post_start_time, '9') @@ -2137,7 +2145,9 @@ def individual_post_as_html(signing_priv_key_pem: str, box_name, page_number) if post_is_sensitive and reaction_str: reaction_str = '
' + reaction_str - post_html = '
\n' post_html += avatar_image_in_post post_html += '
\n' + \ From 139aad9de1ea4d3d20f6a1477f2325ebe8346619 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 May 2022 12:00:22 +0100 Subject: [PATCH 2/9] Use socialmediapost semantics --- webapp_post.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 4e989b8c6..92e2177a4 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1212,7 +1212,7 @@ def _get_reply_html(translate: {}, 'class="announceOrReply"/>\n' + \ ' ' + \ - '' + \ + '' + \ reply_display_name + '\n' @@ -1422,12 +1422,12 @@ def _get_footer_with_icons(show_icons: bool, footer_str += delete_str + mute_str + edit_str if not is_news_post(post_json_object): footer_str += ' ' + \ + time_class + '">\n' else: footer_str += ' ' + \ + '" class="' + time_class + '">\n' footer_str += '
\n' footer_str += ' \n' @@ -1724,7 +1724,7 @@ def individual_post_as_html(signing_priv_key_pem: str, nickname + '?options=' + post_actor + \ ';' + str(page_number) + ';' + avatar_url + message_id_str + \ '">' + \ - '' + display_name + '' + \ + '' + \ '\n' else: if not message_id: @@ -1741,7 +1741,7 @@ def individual_post_as_html(signing_priv_key_pem: str, ' @' + actor_handle + '\n' + '">@\n' # benchmark 9 _log_post_timing(enable_timing_log, post_start_time, '9') @@ -2146,7 +2146,7 @@ def individual_post_as_html(signing_priv_key_pem: str, if post_is_sensitive and reaction_str: reaction_str = '
' + reaction_str post_html = '
\n' post_html += avatar_image_in_post From c71259b4faeeb7cb39767bc3fd0007b009b65856 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 May 2022 12:16:39 +0100 Subject: [PATCH 3/9] Semantic markup for content warning --- webapp_post.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 92e2177a4..7414624d5 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -2072,7 +2072,9 @@ def individual_post_as_html(signing_priv_key_pem: str, encrypted_str = translate[encrypted_str] object_content = '🔒 ' + encrypted_str - object_content = '
' + object_content + '
' + object_content = \ + '
' + \ + object_content + '
' if not post_is_sensitive: content_str = object_content + attachment_str @@ -2091,7 +2093,8 @@ def individual_post_as_html(signing_priv_key_pem: str, nickname, domain, summary_str, False) content_str += \ - '\n ' + '\n' if is_moderation_post: container_class = 'container report' # get the content warning text From e027a2af21698c662c79c3080f22229919dbe2bf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 May 2022 12:58:24 +0100 Subject: [PATCH 4/9] Semantic markup for left and right columns --- webapp_column_left.py | 2 +- webapp_column_right.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp_column_left.py b/webapp_column_left.py index 726c73fe0..a1b057d51 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -239,7 +239,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str, new_tab_str = ' target="_blank" rel="nofollow noopener noreferrer"' if links_list: - html_str += '