From e3ce8712268b7fc04c11f34b08d1f0cd75b4607f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 27 Jun 2021 23:01:58 +0100 Subject: [PATCH] Moderation buttons function --- webapp_timeline.py | 156 ++++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 72 deletions(-) diff --git a/webapp_timeline.py b/webapp_timeline.py index d6fd2afde..0e44d93ea 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -189,6 +189,87 @@ def _htmlTimelineNewPost(manuallyApproveFollowers: bool, return newPostButtonStr +def _htmlTimelineModerationButtons(moderator: bool, boxName: str, + nickname: str, moderationActionStr: str, + translate: {}) -> str: + """Returns html for the moderation screen buttons + """ + tlStr = '' + if moderator and boxName == 'moderation': + tlStr += \ + '
' + tlStr += '
\n' + idx = 'Nickname or URL. Block using *@domain or nickname@domain' + tlStr += \ + ' ' + translate[idx] + '
\n' + if moderationActionStr: + tlStr += '
\n' + else: + tlStr += '
\n' + + tlStr += \ + ' \n' + tlStr += \ + ' \n' + + tlStr += \ + ' \n' + tlStr += \ + ' \n' + + tlStr += \ + ' \n' + tlStr += \ + ' \n' + + tlStr += \ + ' \n' + tlStr += \ + ' \n' + + tlStr += '
\n
\n' + return tlStr + + def htmlTimeline(cssCache: {}, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, translate: {}, pageNumber: int, @@ -575,78 +656,9 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, tlStr += '
\n' # second row of buttons for moderator actions - if moderator and boxName == 'moderation': - tlStr += \ - '
' - tlStr += '
\n' - idx = 'Nickname or URL. Block using *@domain or nickname@domain' - tlStr += \ - ' ' + translate[idx] + '
\n' - if moderationActionStr: - tlStr += '
\n' - else: - tlStr += '
\n' - - tlStr += \ - ' \n' - tlStr += \ - ' \n' - - tlStr += \ - ' \n' - tlStr += \ - ' \n' - - tlStr += \ - ' \n' - tlStr += \ - ' \n' - - tlStr += \ - ' \n' - tlStr += \ - ' \n' - - tlStr += '
\n
\n' + tlStr += \ + _htmlTimelineModerationButtons(moderator, boxName, nickname, + moderationActionStr, translate) _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '6')