Text mode logo on login screen

merge-requests/30/head
Bob Mottram 2021-02-06 14:30:18 +00:00
parent f4ba16484b
commit cc97ecb322
3 changed files with 28 additions and 0 deletions

8
img/logo.txt 100644
View File

@ -0,0 +1,8 @@
8888888888 8888888b. 8888888 .d8888b. Y88b d88P .d88888b. 888b 888
888 888 Y88b 888 d88P Y88b Y88b d88P d88P" "Y88b 8888b 888
888 888 888 888 888 888 Y88o88P 888 888 88888b 888
8888888 888 d88P 888 888 Y888P 888 888 888Y88b 888
888 8888888P" 888 888 888 888 888 888 Y88b888
888 888 888 888 888 888 888 888 888 Y88888
888 888 888 Y88b d88P 888 Y88b. .d88P 888 Y8888
8888888888 888 8888888 "Y8888P" 888 "Y88888P" 888 Y888

View File

@ -434,6 +434,20 @@ def getTextModeBanner(baseDir: str) -> str:
return None
def getTextModeLogo(baseDir: str) -> str:
"""Returns the login screen logo used for shell browsers, like Lynx
"""
textModeLogoFilename = baseDir + '/accounts/logo.txt'
if not os.path.isfile(textModeLogoFilename):
textModeLogoFilename = baseDir + '/img/logo.txt'
with open(textModeLogoFilename, 'r') as fp:
logoStr = fp.read()
if logoStr:
return logoStr.replace('\n', '<br>')
return None
def _setThemeImages(baseDir: str, name: str) -> None:
"""Changes the profile background image
and banner to the defaults

View File

@ -13,6 +13,8 @@ from utils import getConfigParam
from utils import noOfAccounts
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import htmlKeyboardNavigation
from theme import getTextModeLogo
def htmlGetLoginCredentials(loginParams: str,
@ -75,6 +77,9 @@ def htmlLogin(cssCache: {}, translate: {},
loginImageFilename = baseDir + '/accounts/' + loginImage
copyfile(baseDir + '/img/login.png', loginImageFilename)
textModeLogo = getTextModeLogo(baseDir)
textModeLogoHtml = htmlKeyboardNavigation(textModeLogo, {})
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
copyfile(baseDir + '/accounts/login-background-custom.jpg',
@ -141,6 +146,7 @@ def htmlLogin(cssCache: {}, translate: {},
instanceTitle = getConfigParam(baseDir, 'instanceTitle')
if not instanceTitle:
instanceTitle = "Epicyon"
loginForm += textModeLogoHtml + '\n'
loginForm += \
' <img loading="lazy" src="' + loginImage + \
'" alt="' + instanceTitle + '" class="loginimage">\n'