Display profile after handle search

merge-requests/8/head
Bob Mottram 2020-11-12 23:38:58 +00:00
parent 7c6924acd2
commit a4aa41c315
1 changed files with 33 additions and 13 deletions

View File

@ -209,19 +209,13 @@ def htmlProfileAfterSearch(cssCache: {},
if '<' in avatarDescription:
avatarDescription = removeHtml(avatarDescription)
profileStr = ' <div class="hero-image">\n'
profileStr += ' <div class="hero-text">\n'
if avatarUrl:
profileStr += \
' <img loading="lazy" src="' + avatarUrl + \
'" alt="' + avatarDescription + '" title="' + \
avatarDescription + '" class="title">\n'
profileStr += ' <h1>' + displayName + '</h1>\n'
profileStr += ' <p><b>@' + searchNickname + '@' + \
searchDomainFull + '</b></p>\n'
profileStr += ' <p>' + profileDescriptionShort + '</p>\n'
profileStr += ' </div>\n'
profileStr += '</div>\n'
profileStr = \
getProfileHeaderAfterSearch(baseDir, searchNickname,
searchDomainFull,
translate,
displayName,
profileDescriptionShort,
avatarUrl)
profileStr += '<div class="container">\n'
profileStr += ' <form method="POST" action="' + \
@ -309,6 +303,32 @@ def getProfileHeader(baseDir: str, nickname: str, domain: str,
return htmlStr
def getProfileHeaderAfterSearch(baseDir: str, searchNickname: str,
searchDomainFull: str,
translate: {},
displayName: str,
profileDescriptionShort: str,
avatarUrl: 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 += ' <figcaption>\n'
if avatarUrl:
htmlStr += \
' <img loading="lazy" src="' + avatarUrl + '" ' + \
' class="title">\n'
htmlStr += ' <h1>' + displayName + '</h1>\n'
htmlStr += \
' <p><b>@' + searchNickname + '@' + searchDomainFull + '</b><br>\n'
htmlStr += ' <p>' + profileDescriptionShort + '</p>\n'
htmlStr += ' </figcaption>\n'
htmlStr += ' </figure>\n\n'
return htmlStr
def htmlProfile(rssIconAtTop: bool,
cssCache: {}, iconsAsButtons: bool,
defaultTimeline: str,