diff --git a/webapp_about.py b/webapp_about.py index 8ef64f1a..2f58b81d 100644 --- a/webapp_about.py +++ b/webapp_about.py @@ -9,7 +9,7 @@ __status__ = "Production" import os from shutil import copyfile from utils import getConfigParam -from webapp_utils import htmlHeaderWithExternalStyle +from webapp_utils import htmlHeaderWithExternalStyles from webapp_utils import htmlFooter @@ -32,12 +32,24 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str, with open(baseDir + '/accounts/about.txt', 'r') as aboutFile: aboutText = aboutFile.read() - aboutForm = '' - cssFilename = baseDir + '/epicyon-profile.css' - if os.path.isfile(baseDir + '/epicyon.css'): - cssFilename = baseDir + '/epicyon.css' + cssFiles = [] - aboutForm = htmlHeaderWithExternalStyle(cssFilename) + aboutForm = '' + cssFiles.append(baseDir + '/epicyon-profile.css') + if os.path.isfile(baseDir + '/epicyon.css'): + cssFiles[0] = baseDir + '/epicyon.css' + + # TODO: Clean up and remove this override + cssFiles[0] = 'base.css' + + # Get theme-specific css if exists - must be named '.css' + themeName = getConfigParam(baseDir, 'theme') + + themePath = f'{baseDir}/theme/{themeName}.css' + if os.path.isfile(themePath): + cssFiles.append('theme/' + themeName + '.css') + + aboutForm = htmlHeaderWithExternalStyles(cssFiles) aboutForm += '
' + aboutText + '
' if onionDomain: aboutForm += \ diff --git a/webapp_tos.py b/webapp_tos.py index 346b86b6..1e53df42 100644 --- a/webapp_tos.py +++ b/webapp_tos.py @@ -9,7 +9,7 @@ __status__ = "Production" import os from shutil import copyfile from utils import getConfigParam -from webapp_utils import htmlHeaderWithExternalStyle +from webapp_utils import htmlHeaderWithExternalStyles from webapp_utils import htmlFooter @@ -32,12 +32,24 @@ def htmlTermsOfService(cssCache: {}, baseDir: str, with open(baseDir + '/accounts/tos.txt', 'r') as file: TOSText = file.read() - TOSForm = '' - cssFilename = baseDir + '/epicyon-profile.css' - if os.path.isfile(baseDir + '/epicyon.css'): - cssFilename = baseDir + '/epicyon.css' + cssFiles = [] - TOSForm = htmlHeaderWithExternalStyle(cssFilename) + TOSForm = '' + cssFiles.append(baseDir + '/epicyon-profile.css') + if os.path.isfile(baseDir + '/epicyon.css'): + cssFiles[0] = baseDir + '/epicyon.css' + + # TODO: Clean up and remove this override + cssFiles[0] = 'base.css' + + # Get theme-specific css if exists - must be named '.css' + themeName = getConfigParam(baseDir, 'theme') + + themePath = f'{baseDir}/theme/{themeName}.css' + if os.path.isfile(themePath): + cssFiles.append('theme/' + themeName + '.css') + + TOSForm = htmlHeaderWithExternalStyles(cssFiles) TOSForm += '
' + TOSText + '
\n' if adminNickname: adminActor = httpPrefix + '://' + domainFull + \