Link back to moderator screen

main
Bob Mottram 2020-12-09 19:17:42 +00:00
parent c3a4d8d05c
commit 1e52123c0d
2 changed files with 7 additions and 4 deletions

View File

@ -1403,6 +1403,7 @@ class PubServer(BaseHTTPRequestHandler):
"""Actions on the moderator screeen
"""
usersPath = path.replace('/moderationaction', '')
nickname = usersPath.replace('/users/', '')
actorStr = httpPrefix + '://' + domainFull + usersPath
length = int(self.headers['Content-length'])
@ -1441,7 +1442,8 @@ class PubServer(BaseHTTPRequestHandler):
elif moderationStr.startswith('submitInfo'):
msg = htmlModerationInfo(self.server.cssCache,
self.server.translate,
baseDir, httpPrefix)
baseDir, httpPrefix,
nickname)
msg = msg.encode('utf-8')
self._login_headers('text/html',
len(msg), callingDomain)

View File

@ -45,7 +45,8 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
def htmlModerationInfo(cssCache: {}, translate: {},
baseDir: str, httpPrefix: str) -> str:
baseDir: str, httpPrefix: str,
nickname: str) -> str:
msgStr1 = \
'These are globally blocked for all accounts on this instance'
msgStr2 = \
@ -58,9 +59,9 @@ def htmlModerationInfo(cssCache: {}, translate: {},
infoForm = htmlHeaderWithExternalStyle(cssFilename)
infoForm += \
'<center><h1>' + \
'<center><h1><a href="/users/' + nickname + '/moderation">' + \
translate['Moderation Information'] + \
'</h1></center>'
'</a></h1></center>'
infoShown = False
suspendedFilename = baseDir + '/accounts/suspended.txt'