Indicate new followers during keyboard navigation

main
Bob Mottram 2021-02-05 18:46:42 +00:00
parent 36963fe3fc
commit 17a334bd29
2 changed files with 14 additions and 2 deletions

View File

@ -392,7 +392,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
}
if moderator:
navLinks[translate['Mod']] = usersPath + '/moderation'
tlStr += htmlKeyboardNavigation(navLinks)
tlStr += htmlKeyboardNavigation(navLinks,
usersPath, translate, followApprovals)
# banner and row of buttons
tlStr += \

View File

@ -880,10 +880,21 @@ def getAvatarImageUrl(session,
return avatarUrl
def htmlKeyboardNavigation(links: {}) -> str:
def htmlKeyboardNavigation(links: {},
usersPath=None, translate=None,
followApprovals=False) -> str:
"""Given a set of links return the html for keyboard navigation
"""
htmlStr = '<div class="transparent"><ul>'
# show new follower approvals
if usersPath and translate and followApprovals:
htmlStr += '<label class="transparent">' + \
'<a href="' + usersPath + '/followers#timeline">' + \
translate['Approve follow requests'] + '</a>' + \
'</label><br><br>'
# show the list of links
for title, url in links.items():
htmlStr += '<li><label class="transparent">' + \
'<a href="' + str(url) + '">' + \