Load theme as a user setting; allow the user to change it; update tests.

This commit is contained in:
Paulo Reis
2018-08-27 15:25:00 +01:00
parent 2fbcaebac7
commit efc926ffc5
14 changed files with 53 additions and 21 deletions
@@ -163,6 +163,12 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
return Url.resolve(staticFilesBase, hashedPath)
return Url.resolve(staticFilesBase, path)
res.locals.buildCssFileName = (userSettings) ->
themeModifier = ""
if userSettings?.overallTheme? and Settings.overleaf?
themeModifier = userSettings.overallTheme
return "/" + Settings.brandPrefix + themeModifier + "style.css"
res.locals.buildImgPath = (imgFile)->
path = Path.join("/img/", imgFile)
return Url.resolve(staticFilesBase, path)