Include theme in banner image url

merge-requests/8/head
Bob Mottram 2020-12-20 17:26:38 +00:00
parent 59f4d75d78
commit 86dfa128c6
9 changed files with 108 additions and 79 deletions

View File

@ -6661,6 +6661,7 @@ class PubServer(BaseHTTPRequestHandler):
YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
actorJson['roles'],
None, None)
@ -6741,6 +6742,7 @@ class PubServer(BaseHTTPRequestHandler):
YTReplacementDomain,
showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
actorJson['skills'],
None, None)
@ -7102,7 +7104,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
if GETstartTime:
self._benchmarkGETtimings(GETstartTime, GETtimings,
'show status done',
@ -7225,7 +7228,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized, self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7341,7 +7344,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized, self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7457,7 +7460,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7573,7 +7577,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7698,7 +7703,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7819,7 +7825,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -7903,7 +7910,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized, self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -8003,7 +8010,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -8122,7 +8130,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -8233,7 +8242,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons,
self.server.rssIconAtTop,
self.server.publishButtonAtTop,
authorized)
authorized,
self.server.themeName)
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -8430,6 +8440,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
shares,
pageNumber, sharesPerPage)
@ -8522,6 +8533,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
following,
pageNumber,
@ -8614,6 +8626,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
followers,
pageNumber,
@ -8681,6 +8694,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
None, None).encode('utf-8')
self._set_headers('text/html', len(msg),
@ -8927,8 +8941,8 @@ class PubServer(BaseHTTPRequestHandler):
return True
def _columnImage(self, side: str, callingDomain: str, path: str,
baseDir: str, domain: str, port: int,
GETstartTime, GETtimings: {}) -> bool:
baseDir: str, domain: str, port: int,
GETstartTime, GETtimings: {}) -> bool:
"""Shows an image at the top of the left/right column
"""
nickname = getNicknameFromActor(path)
@ -9240,7 +9254,7 @@ class PubServer(BaseHTTPRequestHandler):
def _editLinks(self, callingDomain: str, path: str,
translate: {}, baseDir: str,
httpPrefix: str, domain: str, port: int,
cookie: str) -> bool:
cookie: str, theme: str) -> bool:
"""Show the links from the left column
"""
if '/users/' in path and path.endswith('/editlinks'):
@ -9250,7 +9264,8 @@ class PubServer(BaseHTTPRequestHandler):
path, domain,
port,
httpPrefix,
self.server.defaultTimeline).encode('utf-8')
self.server.defaultTimeline,
theme).encode('utf-8')
if msg:
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -10267,7 +10282,8 @@ class PubServer(BaseHTTPRequestHandler):
authorized,
rssIconAtTop,
iconsAsButtons,
defaultTimeline).encode('utf-8')
defaultTimeline,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -10298,7 +10314,8 @@ class PubServer(BaseHTTPRequestHandler):
authorized,
self.server.rssIconAtTop,
iconsAsButtons,
defaultTimeline).encode('utf-8')
defaultTimeline,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg), cookie, callingDomain)
self._write(msg)
self.server.GETbusy = False
@ -10366,7 +10383,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.translate,
self.server.baseDir, self.path,
self.server.domain,
self.server.defaultTimeline).encode('utf-8')
self.server.defaultTimeline,
self.server.theme).encode('utf-8')
self._set_headers('text/html', len(msg), cookie, callingDomain)
self._write(msg)
self.server.GETbusy = False
@ -10380,7 +10398,8 @@ class PubServer(BaseHTTPRequestHandler):
msg = htmlSearchHashtagCategory(self.server.cssCache,
self.server.translate,
self.server.baseDir, self.path,
self.server.domain)
self.server.domain,
self.server.themeName)
if msg:
msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), cookie, callingDomain)
@ -10872,7 +10891,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.httpPrefix,
self.server.domain,
self.server.port,
cookie):
cookie,
self.server.themeName):
return
# edit newswire from the right column of the timeline

View File

@ -70,7 +70,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
editor: bool,
showBackButton: bool, timelinePath: str,
rssIconAtTop: bool, showHeaderImage: bool,
frontPage: bool) -> str:
frontPage: bool, theme: str) -> str:
"""Returns html content for the left column
"""
htmlStr = ''
@ -83,7 +83,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
editImageClass = ''
if showHeaderImage:
leftImageFile, leftColumnImageFilename = \
getLeftImageFile(baseDir, nickname, domain)
getLeftImageFile(baseDir, nickname, domain, theme)
if not os.path.isfile(leftColumnImageFilename):
theme = getConfigParam(baseDir, 'theme').lower()
if theme == 'default':
@ -92,7 +92,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
theme = '_' + theme
themeLeftImageFile, themeLeftColumnImageFilename = \
getImageFile(baseDir, 'left_col_image', baseDir + '/img',
nickname, domain)
nickname, domain, theme)
if os.path.isfile(themeLeftColumnImageFilename):
leftColumnImageFilename = \
baseDir + '/accounts/' + \
@ -255,7 +255,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
timelinePath: str, authorized: bool,
rssIconAtTop: bool,
iconsAsButtons: bool,
defaultTimeline: str) -> str:
defaultTimeline: str,
theme: str) -> str:
"""Show the left column links within mobile view
"""
htmlStr = ''
@ -276,7 +277,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
domain = domain.split(':')[0]
htmlStr = htmlHeaderWithExternalStyle(cssFilename)
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
htmlStr += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
@ -293,7 +295,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
httpPrefix, translate,
editor,
False, timelinePath,
rssIconAtTop, False, False)
rssIconAtTop, False, False,
theme)
else:
if editor:
htmlStr += '<br><br><br>\n'
@ -310,7 +313,7 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
domain: str, port: int, httpPrefix: str,
defaultTimeline: str) -> str:
defaultTimeline: str, theme: str) -> str:
"""Shows the edit links screen
"""
if '/users/' not in path:
@ -331,7 +334,8 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
cssFilename = baseDir + '/links.css'
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
editLinksForm = htmlHeaderWithExternalStyle(cssFilename)

View File

@ -51,7 +51,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool,
showHeaderImage: bool) -> str:
showHeaderImage: bool,
theme: str) -> str:
"""Returns html content for the right column
"""
htmlStr = ''
@ -84,7 +85,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
editImageClass = ''
if showHeaderImage:
rightImageFile, rightColumnImageFilename = \
getRightImageFile(baseDir, nickname, domain)
getRightImageFile(baseDir, nickname, domain, theme)
if not os.path.isfile(rightColumnImageFilename):
theme = getConfigParam(baseDir, 'theme').lower()
if theme == 'default':
@ -93,7 +94,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
theme = '_' + theme
themeRightImageFile, themeRightColumnImageFilename = \
getImageFile(baseDir, 'right_col_image', baseDir + '/img',
nickname, domain)
nickname, domain, theme)
if os.path.isfile(themeRightColumnImageFilename):
rightColumnImageFilename = \
baseDir + '/accounts/' + \
@ -412,7 +413,8 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
authorized: bool,
rssIconAtTop: bool,
iconsAsButtons: bool,
defaultTimeline: str) -> str:
defaultTimeline: str,
theme: str) -> str:
"""Shows the mobile version of the newswire right column
"""
htmlStr = ''
@ -456,7 +458,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
newswire, positiveVoting,
False, timelinePath, showPublishButton,
showPublishAsIcon, rssIconAtTop, False,
authorized, False)
authorized, False, theme)
else:
if editor:
htmlStr += '<br><br><br>\n'

View File

@ -83,7 +83,7 @@ def htmlFrontScreen(rssIconAtTop: bool,
session, wfRequest: {}, personCache: {},
YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, extraJson=None,
newswire: {}, theme: str, extraJson=None,
pageNumber=None, maxItemsPerPage=None) -> str:
"""Show the news instance front screen
"""
@ -124,7 +124,7 @@ def htmlFrontScreen(rssIconAtTop: bool,
getLeftColumnContent(baseDir, 'news', domainFull,
httpPrefix, translate,
False, False, None, rssIconAtTop, True,
True)
True, theme)
profileHeaderStr += ' </td>\n'
profileHeaderStr += ' <td valign="top" class="col-center">\n'
@ -155,7 +155,7 @@ def htmlFrontScreen(rssIconAtTop: bool,
httpPrefix, translate,
False, False, newswire, False,
False, None, False, False,
False, True, authorized, True)
False, True, authorized, True, theme)
profileFooterStr += ' </td>\n'
profileFooterStr += ' </tr>\n'
profileFooterStr += ' </tbody>\n'

View File

@ -231,7 +231,8 @@ def htmlHashTagSwarm(baseDir: str, actor: str, translate: {}) -> str:
def htmlSearchHashtagCategory(cssCache: {}, translate: {},
baseDir: str, path: str, domain: str) -> str:
baseDir: str, path: str, domain: str,
theme: str) -> str:
"""Show hashtags after selecting a category on the main search screen
"""
actor = path.split('/category/')[0]
@ -251,7 +252,7 @@ def htmlSearchHashtagCategory(cssCache: {}, translate: {},
# show a banner above the search box
searchBannerFile, searchBannerFilename = \
getSearchBannerFile(baseDir, searchNickname, domain)
getSearchBannerFile(baseDir, searchNickname, domain, theme)
if not os.path.isfile(searchBannerFilename):
# get the default search banner for the theme
theme = getConfigParam(baseDir, 'theme').lower()
@ -261,7 +262,7 @@ def htmlSearchHashtagCategory(cssCache: {}, translate: {},
theme = '_' + theme
themeSearchImageFile, themeSearchBannerFilename = \
getImageFile(baseDir, 'search_banner', baseDir + '/img',
searchNickname, domain)
searchNickname, domain, theme)
if os.path.isfile(themeSearchBannerFilename):
searchBannerFilename = \
baseDir + '/accounts/' + \

View File

@ -370,7 +370,7 @@ def htmlProfile(rssIconAtTop: bool,
session, wfRequest: {}, personCache: {},
YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, dormantMonths: int,
newswire: {}, theme: str, dormantMonths: int,
extraJson=None, pageNumber=None,
maxItemsPerPage=None) -> str:
"""Show the profile page as html
@ -389,7 +389,7 @@ def htmlProfile(rssIconAtTop: bool,
session, wfRequest, personCache,
YTReplacementDomain,
showPublishedDateOnly,
newswire, extraJson,
newswire, theme, extraJson,
pageNumber, maxItemsPerPage)
domain, port = getDomainFromActor(profileJson['id'])

View File

@ -312,7 +312,7 @@ def htmlSearchEmojiTextEntry(cssCache: {}, translate: {},
def htmlSearch(cssCache: {}, translate: {},
baseDir: str, path: str, domain: str,
defaultTimeline: str) -> str:
defaultTimeline: str, theme: str) -> str:
"""Search called from the timeline icon
"""
actor = path.replace('/search', '')
@ -331,7 +331,7 @@ def htmlSearch(cssCache: {}, translate: {},
# show a banner above the search box
searchBannerFile, searchBannerFilename = \
getSearchBannerFile(baseDir, searchNickname, domain)
getSearchBannerFile(baseDir, searchNickname, domain, theme)
if not os.path.isfile(searchBannerFilename):
# get the default search banner for the theme
theme = getConfigParam(baseDir, 'theme').lower()
@ -341,7 +341,7 @@ def htmlSearch(cssCache: {}, translate: {},
theme = '_' + theme
themeSearchImageFile, themeSearchBannerFilename = \
getImageFile(baseDir, 'search_banner', baseDir + '/img',
searchNickname, domain)
searchNickname, domain, theme)
if os.path.isfile(themeSearchBannerFilename):
searchBannerFilename = \
baseDir + '/accounts/' + \

View File

@ -60,7 +60,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool,
moderationActionStr: str) -> str:
moderationActionStr: str,
theme: str) -> str:
"""Show the timeline as html
"""
enableTimingLog = False
@ -404,7 +405,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
getLeftColumnContent(baseDir, nickname, domainFull,
httpPrefix, translate,
editor, False, None, rssIconAtTop,
True, False)
True, False, theme)
tlStr += ' <td valign="top" class="col-left">' + \
leftColumnStr + ' </td>\n'
# center column containing posts
@ -605,7 +606,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
False, None, True,
showPublishAsIcon,
rssIconAtTop, publishButtonAtTop,
authorized, True)
authorized, True, theme)
tlStr += ' <td valign="top" class="col-right">' + \
rightColumnStr + ' </td>\n'
tlStr += ' </tr>\n'
@ -718,7 +719,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the shares timeline as html
"""
manuallyApproveFollowers = \
@ -737,7 +738,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInbox(cssCache: {}, defaultTimeline: str,
@ -755,7 +756,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the inbox as html
"""
manuallyApproveFollowers = \
@ -774,7 +775,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlBookmarks(cssCache: {}, defaultTimeline: str,
@ -792,7 +793,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the bookmarks as html
"""
manuallyApproveFollowers = \
@ -811,7 +812,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlEvents(cssCache: {}, defaultTimeline: str,
@ -829,7 +830,7 @@ def htmlEvents(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the events as html
"""
manuallyApproveFollowers = \
@ -848,7 +849,7 @@ def htmlEvents(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
@ -866,7 +867,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the DM timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -880,7 +881,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
@ -898,7 +899,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the replies timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -913,7 +914,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
@ -931,7 +932,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the media timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -946,7 +947,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
@ -964,7 +965,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the blogs timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -979,7 +980,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
@ -997,7 +998,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool,
theme: str) -> str:
"""Show the features timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -1012,7 +1014,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlInboxNews(cssCache: {}, defaultTimeline: str,
@ -1030,7 +1032,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the news timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
@ -1045,7 +1047,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)
def htmlOutbox(cssCache: {}, defaultTimeline: str,
@ -1063,7 +1065,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
authorized: bool) -> str:
authorized: bool, theme: str) -> str:
"""Show the Outbox as html
"""
manuallyApproveFollowers = \
@ -1079,4 +1081,4 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
newswire, False, False, positiveVoting,
showPublishAsIcon, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None)
authorized, None, theme)

View File

@ -476,7 +476,7 @@ def postContainsPublic(postJsonObject: {}) -> bool:
def getImageFile(baseDir: str, name: str, directory: str,
nickname: str, domain: str) -> (str, str):
nickname: str, domain: str, theme: str) -> (str, str):
"""
returns the filenames for an image with the given name
"""
@ -484,7 +484,7 @@ def getImageFile(baseDir: str, name: str, directory: str,
bannerFile = ''
bannerFilename = ''
for ext in bannerExtensions:
bannerFile = name + '.' + ext
bannerFile = name + '_' + theme + '.' + ext
bannerFilename = directory + '/' + bannerFile
if os.path.isfile(bannerFilename):
break
@ -492,31 +492,31 @@ def getImageFile(baseDir: str, name: str, directory: str,
def getBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'banner',
baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain)
nickname, domain, theme)
def getSearchBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'search_banner',
baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain)
nickname, domain, theme)
def getLeftImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'left_col_image',
baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain)
nickname, domain, theme)
def getRightImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'right_col_image',
baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain)
nickname, domain, theme)
def htmlHeaderWithExternalStyle(cssFilename: str, lang='en') -> str: