Accounts in alphabetical order

main
Bob Mottram 2020-12-20 11:31:29 +00:00
parent d312da3cfe
commit 2d0fdc2f64
1 changed files with 28 additions and 22 deletions

View File

@ -163,15 +163,21 @@ def htmlModerationInfo(cssCache: {}, translate: {},
infoForm += ' <col span="1" class="accountsTableCol">\n'
infoForm += ' </colgroup>\n'
infoForm += '<tr>\n'
col = 0
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
accountDir = os.path.join(baseDir + '/accounts', acct)
accounts.append(acct)
break
accounts.sort()
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
@ -184,14 +190,14 @@ def htmlModerationInfo(cssCache: {}, translate: {},
'/users/' + nickname + '?options=' + actor + ';1;' + \
'/avatars/' + avatarUrl.replace('/', '-')
infoForm += '<td>\n<a href="' + acctUrl + '">'
infoForm += '<img style="width:90%" src="' + avatarUrl + '" />'
infoForm += '<img loading="lazy" style="width:90%" '
infoForm += 'src="' + avatarUrl + '" />'
infoForm += '<br><center>' + acctNickname
infoForm += '</center></a>\n</td>\n'
col += 1
if col == cols:
# new row of accounts
infoForm += '</tr>\n<tr>\n'
break
infoForm += '</tr>\n</table>\n'
infoForm += '</div>\n'