\n'
if blockedFollowing:
blockedFollowing.sort()
infoForm += '
\n'
infoForm += '
' + translate['Blocked following'] + '
\n'
infoForm += \
'
' + \
translate['Receives posts from the following accounts'] + \
':
\n'
for actor in blockedFollowing:
followingNickname = getNicknameFromActor(actor)
followingDomain, followingPort = getDomainFromActor(actor)
followingDomainFull = \
getFullDomain(followingDomain, followingPort)
infoForm += '' + \
followingNickname + '@' + followingDomainFull + \
'
\n'
infoForm += '
\n'
if blockedFollowers:
blockedFollowers.sort()
infoForm += '
\n'
infoForm += '
' + translate['Blocked followers'] + '
\n'
infoForm += \
'
' + \
translate['Sends out posts to the following accounts'] + \
':
\n'
for actor in blockedFollowers:
followerNickname = getNicknameFromActor(actor)
followerDomain, followerPort = getDomainFromActor(actor)
followerDomainFull = getFullDomain(followerDomain, followerPort)
infoForm += '' + \
followerNickname + '@' + followerDomainFull + '
\n'
infoForm += '
\n'
if wordFrequency:
maxCount = 1
for word, count in wordFrequency.items():
if count > maxCount:
maxCount = count
minimumWordCount = int(maxCount / 2)
if minimumWordCount >= 3:
infoForm += '
\n'
infoForm += '
' + translate['Word frequencies'] + '
\n'
wordSwarm = ''
ctr = 0
for word, count in wordFrequency.items():
if count >= minimumWordCount:
if ctr > 0:
wordSwarm += ' '
if count < maxCount - int(maxCount / 4):
wordSwarm += word
else:
if count != maxCount:
wordSwarm += '' + word + ''
else:
wordSwarm += '' + word + ''
ctr += 1
infoForm += wordSwarm
infoForm += '
\n'
infoForm += htmlFooter()
return infoForm
def htmlModerationInfo(cssCache: {}, translate: {},
baseDir: str, httpPrefix: str,
nickname: str) -> str:
msgStr1 = \
'These are globally blocked for all accounts on this instance'
msgStr2 = \
'Any blocks or suspensions made by moderators will be shown here.'
infoForm = ''
cssFilename = baseDir + '/epicyon-profile.css'
if os.path.isfile(baseDir + '/epicyon.css'):
cssFilename = baseDir + '/epicyon.css'
instanceTitle = \
getConfigParam(baseDir, 'instanceTitle')
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle)
infoForm += \
'
'
infoShown = False
accounts = []
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct or 'news@' in acct:
continue
accounts.append(acct)
break
accounts.sort()
cols = 5
if len(accounts) > 10:
infoForm += '' + translate['Show Accounts']
infoForm += '\n'
infoForm += '
\n'
infoForm += '
\n'
infoForm += '
\n'
for col in range(cols):
infoForm += '
\n'
infoForm += '
\n'
infoForm += '
\n'
col = 0
for acct in accounts:
acctNickname = acct.split('@')[0]
accountDir = os.path.join(baseDir + '/accounts', acct)
actorJson = loadJson(accountDir + '.json')
if not actorJson:
continue
actor = actorJson['id']
avatarUrl = ''
ext = ''
if actorJson.get('icon'):
if actorJson['icon'].get('url'):
avatarUrl = actorJson['icon']['url']
if '.' in avatarUrl:
ext = '.' + avatarUrl.split('.')[-1]
acctUrl = \
'/users/' + nickname + '?options=' + actor + ';1;' + \
'/members/' + acctNickname + ext
infoForm += '