Function for getting the right column image

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

View File

@ -5859,9 +5859,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
# show a column header image, eg. title of the theme or newswire banner # show a column header image, eg. title of the theme or newswire banner
editImageClass = '' editImageClass = ''
if showHeaderImage: if showHeaderImage:
rightColumnImageFilename = \ rightImageFile, rightColumnImageFilename = \
baseDir + '/accounts/' + nickname + '@' + domain + \ getRightImageFile(baseDir, nickname, domain)
'/right_col_image.png'
if not os.path.isfile(rightColumnImageFilename): if not os.path.isfile(rightColumnImageFilename):
theme = getConfigParam(baseDir, 'theme').lower() theme = getConfigParam(baseDir, 'theme').lower()
if theme == 'default': if theme == 'default':
@ -5873,6 +5872,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
if os.path.isfile(themeRightColumnImageFilename): if os.path.isfile(themeRightColumnImageFilename):
copyfile(themeRightColumnImageFilename, copyfile(themeRightColumnImageFilename,
rightColumnImageFilename) rightColumnImageFilename)
rightImageFile = 'right_col_image.png'
# show the image at the top of the column # show the image at the top of the column
editImageClass = 'rightColEdit' editImageClass = 'rightColEdit'
@ -5882,7 +5882,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
'\n <center>\n' + \ '\n <center>\n' + \
' <img class="rightColImg" ' + \ ' <img class="rightColImg" ' + \
'loading="lazy" src="/users/' + \ 'loading="lazy" src="/users/' + \
nickname + '/right_col_image.png" />\n' + \ nickname + '/' + rightImageFile + '" />\n' + \
' </center>\n' ' </center>\n'
if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage: if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage:
@ -6124,6 +6124,11 @@ def getLeftImageFile(baseDir: str,
return getImageFile(baseDir, 'left_col_image', nickname, domain) return getImageFile(baseDir, 'left_col_image', nickname, domain)
def getRightImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
return getImageFile(baseDir, 'right_col_image', nickname, domain)
def headerButtonsFrontScreen(translate: {}, def headerButtonsFrontScreen(translate: {},
nickname: str, boxName: str, nickname: str, boxName: str,
authorized: bool, authorized: bool,