__filename__ = "webapp_frontscreen.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
import os
from utils import isSystemAccount
from utils import getDomainFromActor
from person import personBoxJson
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getIconsWebPath
from webapp_utils import getBannerFile
from webapp_utils import htmlPostSeparator
from webapp_column_left import getLeftColumnContent
from webapp_column_right import getRightColumnContent
from webapp_post import individualPostAsHtml
def headerButtonsFrontScreen(translate: {},
nickname: str, boxName: str,
authorized: bool,
iconsAsButtons: bool,
iconsPath: bool) -> str:
"""Returns the header buttons for the front page of a news instance
"""
headerStr = ''
if nickname == 'news':
buttonFeatures = 'buttonMobile'
buttonNewswire = 'buttonMobile'
buttonLinks = 'buttonMobile'
if boxName == 'features':
buttonFeatures = 'buttonselected'
elif boxName == 'newswire':
buttonNewswire = 'buttonselected'
elif boxName == 'links':
buttonLinks = 'buttonselected'
headerStr += \
' ' + \
''
if not authorized:
headerStr += \
' ' + \
''
if iconsAsButtons:
headerStr += \
' ' + \
''
headerStr += \
' ' + \
''
else:
headerStr += \
' ' + \
'\n'
headerStr += \
' ' + \
'
\n'
else:
if not authorized:
headerStr += \
' ' + \
''
if headerStr:
headerStr = \
'\n
\n' iconsPath = getIconsWebPath(baseDir) profileHeaderStr += \ getLeftColumnContent(baseDir, 'news', domainFull, httpPrefix, translate, iconsPath, False, False, None, rssIconAtTop, True, True) profileHeaderStr += ' | \n' profileHeaderStr += '\n' profileStr = profileHeaderStr cssFilename = baseDir + '/epicyon-profile.css' if os.path.isfile(baseDir + '/epicyon.css'): cssFilename = baseDir + '/epicyon.css' licenseStr = '' bannerFile, bannerFilename = \ getBannerFile(baseDir, nickname, domain) profileStr += \ htmlFrontScreenPosts(recentPostsCache, maxRecentPosts, translate, baseDir, httpPrefix, nickname, domain, port, session, wfRequest, personCache, projectVersion, YTReplacementDomain, showPublishedDateOnly) + licenseStr # Footer which is only used for system accounts profileFooterStr = ' | \n' profileFooterStr += '\n' iconsPath = getIconsWebPath(baseDir) profileFooterStr += \ getRightColumnContent(baseDir, 'news', domainFull, httpPrefix, translate, iconsPath, False, False, newswire, False, False, None, False, False, False, True, authorized, True) profileFooterStr += ' | \n' profileFooterStr += '