Show avatar background after search

merge-requests/8/head
Bob Mottram 2020-11-12 23:44:16 +00:00
parent a4aa41c315
commit f8885e26b7
1 changed files with 9 additions and 4 deletions

View File

@ -209,13 +209,18 @@ def htmlProfileAfterSearch(cssCache: {},
if '<' in avatarDescription:
avatarDescription = removeHtml(avatarDescription)
imageUrl = ''
if profileJson.get('image'):
if profileJson['image'].get('url'):
imageUrl = profileJson['image']['url']
profileStr = \
getProfileHeaderAfterSearch(baseDir, searchNickname,
searchDomainFull,
translate,
displayName,
profileDescriptionShort,
avatarUrl)
avatarUrl, imageUrl)
profileStr += '<div class="container">\n'
profileStr += ' <form method="POST" action="' + \
@ -308,13 +313,13 @@ def getProfileHeaderAfterSearch(baseDir: str, searchNickname: str,
translate: {},
displayName: str,
profileDescriptionShort: str,
avatarUrl: str) -> str:
avatarUrl: str, imageUrl: str) -> str:
"""The header of a searched for handle, containing background
image and avatar
"""
htmlStr = '\n\n <figure class="profileHeader">\n'
# htmlStr += ' <img class="profileBackground" ' + \
# 'src="/users/' + nickname + '/image.png" /></a>\n'
htmlStr += ' <img class="profileBackground" ' + \
'src="' + imageUrl + '" /></a>\n'
htmlStr += ' <figcaption>\n'
if avatarUrl:
htmlStr += \