From 68ce54563f8b06e26f2d8fb27e0bb7cac53e83cf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 3 Oct 2020 11:09:21 +0100 Subject: [PATCH] Copy left and right column images when changing theme --- theme.py | 22 ++++++++++++++++++++++ webinterface.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/theme.py b/theme.py index c62fb1569..d96777f4f 100644 --- a/theme.py +++ b/theme.py @@ -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 diff --git a/webinterface.py b/webinterface.py index 12e3dd1c4..65d0e5362 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5301,7 +5301,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, editImageClass = 'rightColEditImage' htmlStr += \ '\n
\n' + \ - ' \n' + \ '
\n'