Function for getting the left column image

main
Bob Mottram 2020-11-03 10:50:38 +00:00
parent 32cfdf6f38
commit 0e1ecd33dc
1 changed files with 9 additions and 4 deletions

View File

@ -5605,9 +5605,8 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
editImageClass = '' editImageClass = ''
if showHeaderImage: if showHeaderImage:
leftColumnImageFilename = \ leftImageFile, leftColumnImageFilename = \
baseDir + '/accounts/' + nickname + '@' + domain + \ getLeftImageFile(baseDir, nickname, domain)
'/left_col_image.png'
if not os.path.isfile(leftColumnImageFilename): if not os.path.isfile(leftColumnImageFilename):
theme = getConfigParam(baseDir, 'theme').lower() theme = getConfigParam(baseDir, 'theme').lower()
if theme == 'default': if theme == 'default':
@ -5619,6 +5618,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
if os.path.isfile(themeLeftColumnImageFilename): if os.path.isfile(themeLeftColumnImageFilename):
copyfile(themeLeftColumnImageFilename, copyfile(themeLeftColumnImageFilename,
leftColumnImageFilename) leftColumnImageFilename)
leftImageFile = 'left_col_image.png'
# show the image at the top of the column # show the image at the top of the column
editImageClass = 'leftColEdit' editImageClass = 'leftColEdit'
@ -5628,7 +5628,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
'\n <center>\n' + \ '\n <center>\n' + \
' <img class="leftColImg" ' + \ ' <img class="leftColImg" ' + \
'loading="lazy" src="/users/' + \ 'loading="lazy" src="/users/' + \
nickname + '/left_col_image.png" />\n' + \ nickname + '/' + leftImageFile + '" />\n' + \
' </center>\n' ' </center>\n'
if showBackButton: if showBackButton:
@ -6119,6 +6119,11 @@ def getSearchBannerFile(baseDir: str,
return getImageFile(baseDir, 'search_banner', nickname, domain) return getImageFile(baseDir, 'search_banner', nickname, domain)
def getLeftImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
return getImageFile(baseDir, 'left_col_image', nickname, domain)
def headerButtonsFrontScreen(translate: {}, def headerButtonsFrontScreen(translate: {},
nickname: str, boxName: str, nickname: str, boxName: str,
authorized: bool, authorized: bool,