Copy left and right column images when changing theme

merge-requests/8/head
Bob Mottram 2020-10-03 11:09:21 +01:00
parent 70e57fa71a
commit 68ce54563f
2 changed files with 24 additions and 1 deletions

View File

@ -887,6 +887,10 @@ def setThemeImages(baseDir: str, name: str) -> None:
baseDir + '/img/banner.png'
searchBannerFilename = \
baseDir + '/img/search_banner.png'
leftColImageFilename = \
baseDir + '/img/left_col_image.png'
rightColImageFilename = \
baseDir + '/img/right_col_image.png'
else:
profileImageFilename = \
baseDir + '/img/image_' + themeNameLower + '.png'
@ -894,6 +898,10 @@ def setThemeImages(baseDir: str, name: str) -> None:
baseDir + '/img/banner_' + themeNameLower + '.png'
searchBannerFilename = \
baseDir + '/img/search_banner_' + themeNameLower + '.png'
leftColImageFilename = \
baseDir + '/img/left_col_image_' + themeNameLower + '.png'
rightColImageFilename = \
baseDir + '/img/right_col_image_' + themeNameLower + '.png'
backgroundNames = ('login', 'shares', 'delete', 'follow',
'options', 'block', 'search', 'calendar')
@ -960,6 +968,20 @@ def setThemeImages(baseDir: str, name: str) -> None:
except BaseException:
pass
try:
if os.path.isfile(leftColImageFilename):
copyfile(leftColImageFilename,
accountDir + '/left_col_image.png')
except BaseException:
pass
try:
if os.path.isfile(rightColImageFilename):
copyfile(rightColImageFilename,
accountDir + '/right_col_image.png')
except BaseException:
pass
def setTheme(baseDir: str, name: str) -> bool:
result = False

View File

@ -5301,7 +5301,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
editImageClass = 'rightColEditImage'
htmlStr += \
'\n <center>\n' + \
' <img class="rightColImg" loading="lazy" src="/users/' + \
' <img class="rightColImg" ' + \
'loading="lazy" src="/users/' + \
nickname + '/right_col_image.png" />\n' + \
' </center>\n'