mirror of https://gitlab.com/bashrc2/epicyon
Setting custom background for login screen
parent
105fe03426
commit
5207a2ab3c
|
@ -13,6 +13,7 @@ from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import noOfAccounts
|
from utils import noOfAccounts
|
||||||
from utils import getNicknameValidationPattern
|
from utils import getNicknameValidationPattern
|
||||||
|
from webapp_utils import setCustomBackground
|
||||||
from webapp_utils import htmlHeaderWithWebsiteMarkup
|
from webapp_utils import htmlHeaderWithWebsiteMarkup
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import htmlKeyboardNavigation
|
from webapp_utils import htmlKeyboardNavigation
|
||||||
|
@ -92,10 +93,7 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
textModeLogo = getTextModeLogo(baseDir)
|
textModeLogo = getTextModeLogo(baseDir)
|
||||||
textModeLogoHtml = htmlKeyboardNavigation(textModeLogo, {}, {})
|
textModeLogoHtml = htmlKeyboardNavigation(textModeLogo, {}, {})
|
||||||
|
|
||||||
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
backgroundExt = setCustomBackground(baseDir, 'login-background-custom')
|
||||||
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
|
||||||
copyfile(baseDir + '/accounts/login-background-custom.jpg',
|
|
||||||
baseDir + '/accounts/login-background.jpg')
|
|
||||||
|
|
||||||
if accounts > 0:
|
if accounts > 0:
|
||||||
loginText = \
|
loginText = \
|
||||||
|
@ -155,6 +153,11 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
||||||
httpPrefix, domain,
|
httpPrefix, domain,
|
||||||
systemLanguage)
|
systemLanguage)
|
||||||
|
if backgroundExt:
|
||||||
|
loginForm = loginForm.replace('"login-background.jpg"',
|
||||||
|
'"login-background-custom.' +
|
||||||
|
backgroundExt + '"')
|
||||||
|
|
||||||
nicknamePattern = getNicknameValidationPattern()
|
nicknamePattern = getNicknameValidationPattern()
|
||||||
instanceTitle = getConfigParam(baseDir, 'instanceTitle')
|
instanceTitle = getConfigParam(baseDir, 'instanceTitle')
|
||||||
loginForm += \
|
loginForm += \
|
||||||
|
|
Loading…
Reference in New Issue