Less indentation

main
Bob Mottram 2020-12-01 10:15:26 +00:00
parent 67b024e128
commit aea95f131f
1 changed files with 31 additions and 25 deletions

View File

@ -376,11 +376,13 @@ def getAnnounceIconHtml(nickname: str, domainFull: str,
if not isPublicRepeat: if not isPublicRepeat:
announceLink = 'repeatprivate' announceLink = 'repeatprivate'
announceTitle = translate['Repeat this post'] announceTitle = translate['Repeat this post']
if announcedByPerson(postJsonObject, nickname, domainFull): if announcedByPerson(postJsonObject, nickname, domainFull):
announceIcon = 'repeat.png' announceIcon = 'repeat.png'
if not isPublicRepeat: if not isPublicRepeat:
announceLink = 'unrepeatprivate' announceLink = 'unrepeatprivate'
announceTitle = translate['Undo the repeat'] announceTitle = translate['Undo the repeat']
announceStr = \ announceStr = \
' <a class="imageAnchor" href="/users/' + \ ' <a class="imageAnchor" href="/users/' + \
nickname + '?' + announceLink + \ nickname + '?' + announceLink + \
@ -388,6 +390,7 @@ def getAnnounceIconHtml(nickname: str, domainFull: str,
'?actor=' + postJsonObject['actor'] + \ '?actor=' + postJsonObject['actor'] + \
'?bm=' + timelinePostBookmark + \ '?bm=' + timelinePostBookmark + \
'?tl=' + boxName + '" title="' + announceTitle + '">\n' '?tl=' + boxName + '" title="' + announceTitle + '">\n'
announceStr += \ announceStr += \
' ' + \ ' ' + \
'<img loading="lazy" title="' + translate['Repeat this post'] + \ '<img loading="lazy" title="' + translate['Repeat this post'] + \
@ -474,31 +477,34 @@ def getBookmarkIconHtml(nickname: str, domainFull: str,
"""Returns html for bookmark icon/button """Returns html for bookmark icon/button
""" """
bookmarkStr = '' bookmarkStr = ''
if not isModerationPost:
bookmarkIcon = 'bookmark_inactive.png' if isModerationPost:
bookmarkLink = 'bookmark' return bookmarkStr
bookmarkTitle = translate['Bookmark this post']
if bookmarkedByPerson(postJsonObject, nickname, domainFull): bookmarkIcon = 'bookmark_inactive.png'
bookmarkIcon = 'bookmark.png' bookmarkLink = 'bookmark'
bookmarkLink = 'unbookmark' bookmarkTitle = translate['Bookmark this post']
bookmarkTitle = translate['Undo the bookmark'] if bookmarkedByPerson(postJsonObject, nickname, domainFull):
# benchmark 12.6 bookmarkIcon = 'bookmark.png'
if enableTimingLog: bookmarkLink = 'unbookmark'
timeDiff = int((time.time() - postStartTime) * 1000) bookmarkTitle = translate['Undo the bookmark']
if timeDiff > 100: # benchmark 12.6
print('TIMING INDIV ' + boxName + ' 12.6 = ' + str(timeDiff)) if enableTimingLog:
bookmarkStr = \ timeDiff = int((time.time() - postStartTime) * 1000)
' <a class="imageAnchor" href="/users/' + nickname + '?' + \ if timeDiff > 100:
bookmarkLink + '=' + postJsonObject['object']['id'] + \ print('TIMING INDIV ' + boxName + ' 12.6 = ' + str(timeDiff))
pageNumberParam + \ bookmarkStr = \
'?actor=' + postJsonObject['actor'] + \ ' <a class="imageAnchor" href="/users/' + nickname + '?' + \
'?bm=' + timelinePostBookmark + \ bookmarkLink + '=' + postJsonObject['object']['id'] + \
'?tl=' + boxName + '" title="' + bookmarkTitle + '">\n' pageNumberParam + \
bookmarkStr += \ '?actor=' + postJsonObject['actor'] + \
' ' + \ '?bm=' + timelinePostBookmark + \
'<img loading="lazy" title="' + bookmarkTitle + '" alt="' + \ '?tl=' + boxName + '" title="' + bookmarkTitle + '">\n'
bookmarkTitle + ' |" src="/' + iconsPath + \ bookmarkStr += \
'/' + bookmarkIcon + '"/></a>\n' ' ' + \
'<img loading="lazy" title="' + bookmarkTitle + '" alt="' + \
bookmarkTitle + ' |" src="/' + iconsPath + \
'/' + bookmarkIcon + '"/></a>\n'
return bookmarkStr return bookmarkStr