__filename__ = "webapp_themeDesigner.py" __author__ = "Bob Mottram" __license__ = "AGPL3+" __version__ = "1.2.0" __maintainer__ = "Bob Mottram" __email__ = "bob@libreserver.org" __status__ = "Production" __module_group__ = "Web Interface" import os from utils import loadJson from utils import getConfigParam from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlFooter from webapp_utils import getBannerFile def htmlThemeDesigner(cssCache: {}, baseDir: str, nickname: str, domain: str, translate: {}, defaultTimeline: str, themeName: str, accessKeys: {}) -> str: """Edit theme settings """ themeFilename = baseDir + '/theme/' + themeName + '/theme.json' themeJson = {} if os.path.isfile(themeFilename): themeJson = loadJson(themeFilename) themeForm = '' cssFilename = baseDir + '/epicyon-profile.css' if os.path.isfile(baseDir + '/epicyon.css'): cssFilename = baseDir + '/epicyon.css' instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') themeForm = \ htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) bannerFile, bannerFilename = \ getBannerFile(baseDir, nickname, domain, themeName) themeForm += \ '' + \ '\n' themeForm += '
\n' themeForm += \ '

' + translate['Theme Designer'] + '

\n' themeForm += '
\n' themeForm += ' \n' themeForm += ' \n' themeForm += ' \n' themeForm += ' \n' themeForm += ' \n' themeForm += ' \n' for variableName, value in themeJson.items(): if variableName.endswith('-color') or \ variableName.endswith('-text'): themeForm += \ ' ' themeForm += \ '\n' themeForm += '

\n' themeForm += '
\n' themeForm += '
\n' themeForm += htmlFooter() return themeForm