mirror of https://gitlab.com/bashrc2/epicyon
Function for top banner on edit profile screen
parent
7d639023ac
commit
4ad0e7b6b2
|
@ -1838,6 +1838,43 @@ def _htmlEditProfileMain(displayNickname: str, bioStr: str,
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
||||||
|
|
||||||
|
def _htmlEditProfileTopBanner(baseDir: str,
|
||||||
|
nickname: str, domain: str, domainFull: str,
|
||||||
|
defaultTimeline: str, bannerFile: str,
|
||||||
|
path: str, accessKeys: {}, translate: {}) -> str:
|
||||||
|
"""top banner on edit profile screen
|
||||||
|
"""
|
||||||
|
editProfileForm = \
|
||||||
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '">'
|
||||||
|
editProfileForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
'/users/' + nickname + '/' + bannerFile + '" alt="" /></a>\n'
|
||||||
|
|
||||||
|
editProfileForm += \
|
||||||
|
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||||
|
'accept-charset="UTF-8" action="' + path + '/profiledata">\n'
|
||||||
|
editProfileForm += ' <div class="vertical-center">\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <h1>' + translate['Profile for'] + \
|
||||||
|
' ' + nickname + '@' + domainFull + '</h1>'
|
||||||
|
editProfileForm += ' <div class="container">\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <center>\n' + \
|
||||||
|
' <input type="submit" name="submitProfile" ' + \
|
||||||
|
'accesskey="' + accessKeys['submitButton'] + '" ' + \
|
||||||
|
'value="' + translate['Submit'] + '">\n' + \
|
||||||
|
' </center>\n'
|
||||||
|
editProfileForm += ' </div>\n'
|
||||||
|
|
||||||
|
if scheduledPostsExist(baseDir, nickname, domain):
|
||||||
|
editProfileForm += ' <div class="container">\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <input type="checkbox" class="profilecheckbox" ' + \
|
||||||
|
'name="removeScheduledPosts"> ' + \
|
||||||
|
translate['Remove scheduled posts'] + '<br>\n'
|
||||||
|
editProfileForm += ' </div>\n'
|
||||||
|
return editProfileForm
|
||||||
|
|
||||||
|
|
||||||
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
domain: str, port: int, httpPrefix: str,
|
domain: str, port: int, httpPrefix: str,
|
||||||
defaultTimeline: str, theme: str,
|
defaultTimeline: str, theme: str,
|
||||||
|
@ -1987,33 +2024,9 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
|
|
||||||
# top banner
|
# top banner
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
'<a href="/users/' + nickname + '/' + defaultTimeline + '">'
|
_htmlEditProfileTopBanner(baseDir, nickname, domain, domainFull,
|
||||||
editProfileForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
defaultTimeline, bannerFile,
|
||||||
'/users/' + nickname + '/' + bannerFile + '" alt="" /></a>\n'
|
path, accessKeys, translate)
|
||||||
|
|
||||||
editProfileForm += \
|
|
||||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
|
||||||
'accept-charset="UTF-8" action="' + path + '/profiledata">\n'
|
|
||||||
editProfileForm += ' <div class="vertical-center">\n'
|
|
||||||
editProfileForm += \
|
|
||||||
' <h1>' + translate['Profile for'] + \
|
|
||||||
' ' + nickname + '@' + domainFull + '</h1>'
|
|
||||||
editProfileForm += ' <div class="container">\n'
|
|
||||||
editProfileForm += \
|
|
||||||
' <center>\n' + \
|
|
||||||
' <input type="submit" name="submitProfile" ' + \
|
|
||||||
'accesskey="' + accessKeys['submitButton'] + '" ' + \
|
|
||||||
'value="' + translate['Submit'] + '">\n' + \
|
|
||||||
' </center>\n'
|
|
||||||
editProfileForm += ' </div>\n'
|
|
||||||
|
|
||||||
if scheduledPostsExist(baseDir, nickname, domain):
|
|
||||||
editProfileForm += ' <div class="container">\n'
|
|
||||||
editProfileForm += \
|
|
||||||
' <input type="checkbox" class="profilecheckbox" ' + \
|
|
||||||
'name="removeScheduledPosts"> ' + \
|
|
||||||
translate['Remove scheduled posts'] + '<br>\n'
|
|
||||||
editProfileForm += ' </div>\n'
|
|
||||||
|
|
||||||
# main info
|
# main info
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
Loading…
Reference in New Issue