Only show edit button to moderators

main
Bob Mottram 2020-10-01 19:02:48 +01:00
parent 06ffd4ee13
commit 8e9fd5796a
1 changed files with 13 additions and 10 deletions

View File

@ -5152,17 +5152,19 @@ def htmlHighlightLabel(label: str, highlight: bool) -> str:
def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
httpPrefix: str, translate: {}, httpPrefix: str, translate: {},
iconsDir: str) -> str: iconsDir: str, moderator: bool) -> str:
"""Returns html content for the left column """Returns html content for the left column
""" """
htmlStr = \ htmlStr = ''
' <center>\n' + \ if moderator:
' <a href="' + \ htmlStr += \
httpPrefix + '://' + domainFull + \ ' <center>\n' + \
'/users/' + nickname + '/editlinks' + '">' + \ ' <a href="' + \
'<img loading="lazy" alt="" title="" src="/' + \ httpPrefix + '://' + domainFull + \
iconsDir + '/edit.png"/></a>\n' + \ '/users/' + nickname + '/editlinks' + '">' + \
' </center>\n' '<img loading="lazy" alt="" title="" src="/' + \
iconsDir + '/edit.png"/></a>\n' + \
' </center>\n'
return htmlStr return htmlStr
@ -5484,7 +5486,8 @@ def htmlTimeline(defaultTimeline: str,
# left column # left column
leftColumnStr = \ leftColumnStr = \
getLeftColumnContent(baseDir, nickname, domainFull, getLeftColumnContent(baseDir, nickname, domainFull,
httpPrefix, translate, iconsDir) httpPrefix, translate, iconsDir,
moderator)
tlStr += ' <td class="col-left">' + leftColumnStr + '</td>\n' tlStr += ' <td class="col-left">' + leftColumnStr + '</td>\n'
# center column containing posts # center column containing posts
tlStr += ' <td class="col-center">\n' tlStr += ' <td class="col-center">\n'