mirror of https://gitlab.com/bashrc2/epicyon
Show occupation on profile screen
parent
c4e367bd6d
commit
68fe0ed4f8
|
@ -4596,8 +4596,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if actorJson.get('occupationName'):
|
if actorJson.get('occupationName'):
|
||||||
occupationName = actorJson['occupationName']
|
occupationName = actorJson['occupationName']
|
||||||
if fields.get('occupationName'):
|
if fields.get('occupationName'):
|
||||||
if actorJson['occupationName'] != fields['occupationName']:
|
if actorJson['occupationName'] != \
|
||||||
actorJson['occupationName'] = fields['occupationName']
|
fields['occupationName']:
|
||||||
|
actorJson['occupationName'] = \
|
||||||
|
fields['occupationName']
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
else:
|
else:
|
||||||
if occupationName:
|
if occupationName:
|
||||||
|
|
|
@ -343,7 +343,8 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
|
||||||
alsoKnownAs: [],
|
alsoKnownAs: [],
|
||||||
pinnedContent: str,
|
pinnedContent: str,
|
||||||
accessKeys: {},
|
accessKeys: {},
|
||||||
joinedDate: str) -> str:
|
joinedDate: str,
|
||||||
|
occupationName: str) -> str:
|
||||||
"""The header of the profile screen, containing background
|
"""The header of the profile screen, containing background
|
||||||
image and avatar
|
image and avatar
|
||||||
"""
|
"""
|
||||||
|
@ -362,7 +363,14 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
|
||||||
translate['Switch to timeline view'] + '">\n' + \
|
translate['Switch to timeline view'] + '">\n' + \
|
||||||
' <img loading="lazy" src="' + avatarUrl + '" ' + \
|
' <img loading="lazy" src="' + avatarUrl + '" ' + \
|
||||||
'alt="" class="title"></a>\n'
|
'alt="" class="title"></a>\n'
|
||||||
htmlStr += ' <h1>' + displayName + '</h1>\n'
|
|
||||||
|
occupationStr = ''
|
||||||
|
if occupationName:
|
||||||
|
occupationStr += \
|
||||||
|
' <b>' + occupationName + '</b><br>\n'
|
||||||
|
|
||||||
|
htmlStr += ' <h1>' + displayName + '</h1>\n' + occupationStr
|
||||||
|
|
||||||
htmlStr += \
|
htmlStr += \
|
||||||
' <p><b>@' + nickname + '@' + domainFull + '</b><br>\n'
|
' <p><b>@' + nickname + '@' + domainFull + '</b><br>\n'
|
||||||
if joinedDate:
|
if joinedDate:
|
||||||
|
@ -731,6 +739,9 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
if profileJson.get('published'):
|
if profileJson.get('published'):
|
||||||
if 'T' in profileJson['published']:
|
if 'T' in profileJson['published']:
|
||||||
joinedDate = profileJson['published']
|
joinedDate = profileJson['published']
|
||||||
|
occupationName = None
|
||||||
|
if profileJson.get('occupationName'):
|
||||||
|
occupationName = profileJson['occupationName']
|
||||||
|
|
||||||
avatarUrl = profileJson['icon']['url']
|
avatarUrl = profileJson['icon']['url']
|
||||||
|
|
||||||
|
@ -752,7 +763,7 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
loginButton, avatarUrl, theme,
|
loginButton, avatarUrl, theme,
|
||||||
movedTo, alsoKnownAs,
|
movedTo, alsoKnownAs,
|
||||||
pinnedContent, accessKeys,
|
pinnedContent, accessKeys,
|
||||||
joinedDate)
|
joinedDate, occupationName)
|
||||||
|
|
||||||
# keyboard navigation
|
# keyboard navigation
|
||||||
userPathStr = '/users/' + nickname
|
userPathStr = '/users/' + nickname
|
||||||
|
|
Loading…
Reference in New Issue