Include theme in banner image url

alt-html-css
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, YTReplacementDomain,
self.server.showPublishedDateOnly, self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
actorJson['roles'], actorJson['roles'],
None, None) None, None)
@ -6741,6 +6742,7 @@ class PubServer(BaseHTTPRequestHandler):
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly, showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
actorJson['skills'], actorJson['skills'],
None, None) None, None)
@ -7102,7 +7104,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
if GETstartTime: if GETstartTime:
self._benchmarkGETtimings(GETstartTime, GETtimings, self._benchmarkGETtimings(GETstartTime, GETtimings,
'show status done', 'show status done',
@ -7225,7 +7228,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized, self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7341,7 +7344,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized, self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7457,7 +7460,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7573,7 +7577,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7698,7 +7703,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7819,7 +7825,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -7903,7 +7910,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized, self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -8003,7 +8010,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -8122,7 +8130,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -8233,7 +8242,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsAsButtons, self.server.iconsAsButtons,
self.server.rssIconAtTop, self.server.rssIconAtTop,
self.server.publishButtonAtTop, self.server.publishButtonAtTop,
authorized) authorized,
self.server.themeName)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -8430,6 +8440,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly, self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
shares, shares,
pageNumber, sharesPerPage) pageNumber, sharesPerPage)
@ -8522,6 +8533,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly, self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
following, following,
pageNumber, pageNumber,
@ -8614,6 +8626,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly, self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
followers, followers,
pageNumber, pageNumber,
@ -8681,6 +8694,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly, self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.themeName,
self.server.dormantMonths, self.server.dormantMonths,
None, None).encode('utf-8') None, None).encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
@ -8927,8 +8941,8 @@ class PubServer(BaseHTTPRequestHandler):
return True return True
def _columnImage(self, side: str, callingDomain: str, path: str, def _columnImage(self, side: str, callingDomain: str, path: str,
baseDir: str, domain: str, port: int, baseDir: str, domain: str, port: int,
GETstartTime, GETtimings: {}) -> bool: GETstartTime, GETtimings: {}) -> bool:
"""Shows an image at the top of the left/right column """Shows an image at the top of the left/right column
""" """
nickname = getNicknameFromActor(path) nickname = getNicknameFromActor(path)
@ -9240,7 +9254,7 @@ class PubServer(BaseHTTPRequestHandler):
def _editLinks(self, callingDomain: str, path: str, def _editLinks(self, callingDomain: str, path: str,
translate: {}, baseDir: str, translate: {}, baseDir: str,
httpPrefix: str, domain: str, port: int, httpPrefix: str, domain: str, port: int,
cookie: str) -> bool: cookie: str, theme: str) -> bool:
"""Show the links from the left column """Show the links from the left column
""" """
if '/users/' in path and path.endswith('/editlinks'): if '/users/' in path and path.endswith('/editlinks'):
@ -9250,7 +9264,8 @@ class PubServer(BaseHTTPRequestHandler):
path, domain, path, domain,
port, port,
httpPrefix, httpPrefix,
self.server.defaultTimeline).encode('utf-8') self.server.defaultTimeline,
theme).encode('utf-8')
if msg: if msg:
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -10267,7 +10282,8 @@ class PubServer(BaseHTTPRequestHandler):
authorized, authorized,
rssIconAtTop, rssIconAtTop,
iconsAsButtons, iconsAsButtons,
defaultTimeline).encode('utf-8') defaultTimeline,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
self._write(msg) self._write(msg)
@ -10298,7 +10314,8 @@ class PubServer(BaseHTTPRequestHandler):
authorized, authorized,
self.server.rssIconAtTop, self.server.rssIconAtTop,
iconsAsButtons, iconsAsButtons,
defaultTimeline).encode('utf-8') defaultTimeline,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg), cookie, callingDomain) self._set_headers('text/html', len(msg), cookie, callingDomain)
self._write(msg) self._write(msg)
self.server.GETbusy = False self.server.GETbusy = False
@ -10366,7 +10383,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.translate, self.server.translate,
self.server.baseDir, self.path, self.server.baseDir, self.path,
self.server.domain, 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._set_headers('text/html', len(msg), cookie, callingDomain)
self._write(msg) self._write(msg)
self.server.GETbusy = False self.server.GETbusy = False
@ -10380,7 +10398,8 @@ class PubServer(BaseHTTPRequestHandler):
msg = htmlSearchHashtagCategory(self.server.cssCache, msg = htmlSearchHashtagCategory(self.server.cssCache,
self.server.translate, self.server.translate,
self.server.baseDir, self.path, self.server.baseDir, self.path,
self.server.domain) self.server.domain,
self.server.themeName)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), cookie, callingDomain) self._set_headers('text/html', len(msg), cookie, callingDomain)
@ -10872,7 +10891,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.httpPrefix, self.server.httpPrefix,
self.server.domain, self.server.domain,
self.server.port, self.server.port,
cookie): cookie,
self.server.themeName):
return return
# edit newswire from the right column of the timeline # 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, editor: bool,
showBackButton: bool, timelinePath: str, showBackButton: bool, timelinePath: str,
rssIconAtTop: bool, showHeaderImage: bool, rssIconAtTop: bool, showHeaderImage: bool,
frontPage: bool) -> str: frontPage: bool, theme: str) -> str:
"""Returns html content for the left column """Returns html content for the left column
""" """
htmlStr = '' htmlStr = ''
@ -83,7 +83,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
editImageClass = '' editImageClass = ''
if showHeaderImage: if showHeaderImage:
leftImageFile, leftColumnImageFilename = \ leftImageFile, leftColumnImageFilename = \
getLeftImageFile(baseDir, nickname, domain) getLeftImageFile(baseDir, nickname, domain, theme)
if not os.path.isfile(leftColumnImageFilename): if not os.path.isfile(leftColumnImageFilename):
theme = getConfigParam(baseDir, 'theme').lower() theme = getConfigParam(baseDir, 'theme').lower()
if theme == 'default': if theme == 'default':
@ -92,7 +92,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
theme = '_' + theme theme = '_' + theme
themeLeftImageFile, themeLeftColumnImageFilename = \ themeLeftImageFile, themeLeftColumnImageFilename = \
getImageFile(baseDir, 'left_col_image', baseDir + '/img', getImageFile(baseDir, 'left_col_image', baseDir + '/img',
nickname, domain) nickname, domain, theme)
if os.path.isfile(themeLeftColumnImageFilename): if os.path.isfile(themeLeftColumnImageFilename):
leftColumnImageFilename = \ leftColumnImageFilename = \
baseDir + '/accounts/' + \ baseDir + '/accounts/' + \
@ -255,7 +255,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
timelinePath: str, authorized: bool, timelinePath: str, authorized: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
iconsAsButtons: bool, iconsAsButtons: bool,
defaultTimeline: str) -> str: defaultTimeline: str,
theme: str) -> str:
"""Show the left column links within mobile view """Show the left column links within mobile view
""" """
htmlStr = '' htmlStr = ''
@ -276,7 +277,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
domain = domain.split(':')[0] domain = domain.split(':')[0]
htmlStr = htmlHeaderWithExternalStyle(cssFilename) htmlStr = htmlHeaderWithExternalStyle(cssFilename)
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
htmlStr += \ htmlStr += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '">' + \ '<a href="/users/' + nickname + '/' + defaultTimeline + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \ '<img loading="lazy" class="timeline-banner" ' + \
@ -293,7 +295,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
httpPrefix, translate, httpPrefix, translate,
editor, editor,
False, timelinePath, False, timelinePath,
rssIconAtTop, False, False) rssIconAtTop, False, False,
theme)
else: else:
if editor: if editor:
htmlStr += '<br><br><br>\n' htmlStr += '<br><br><br>\n'
@ -310,7 +313,7 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
domain: str, port: int, httpPrefix: str, domain: str, port: int, httpPrefix: str,
defaultTimeline: str) -> str: defaultTimeline: str, theme: str) -> str:
"""Shows the edit links screen """Shows the edit links screen
""" """
if '/users/' not in path: if '/users/' not in path:
@ -331,7 +334,8 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
cssFilename = baseDir + '/links.css' cssFilename = baseDir + '/links.css'
# filename of the banner shown at the top # filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
editLinksForm = htmlHeaderWithExternalStyle(cssFilename) editLinksForm = htmlHeaderWithExternalStyle(cssFilename)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -60,7 +60,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool, authorized: bool,
moderationActionStr: str) -> str: moderationActionStr: str,
theme: str) -> str:
"""Show the timeline as html """Show the timeline as html
""" """
enableTimingLog = False enableTimingLog = False
@ -404,7 +405,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
getLeftColumnContent(baseDir, nickname, domainFull, getLeftColumnContent(baseDir, nickname, domainFull,
httpPrefix, translate, httpPrefix, translate,
editor, False, None, rssIconAtTop, editor, False, None, rssIconAtTop,
True, False) True, False, theme)
tlStr += ' <td valign="top" class="col-left">' + \ tlStr += ' <td valign="top" class="col-left">' + \
leftColumnStr + ' </td>\n' leftColumnStr + ' </td>\n'
# center column containing posts # center column containing posts
@ -605,7 +606,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
False, None, True, False, None, True,
showPublishAsIcon, showPublishAsIcon,
rssIconAtTop, publishButtonAtTop, rssIconAtTop, publishButtonAtTop,
authorized, True) authorized, True, theme)
tlStr += ' <td valign="top" class="col-right">' + \ tlStr += ' <td valign="top" class="col-right">' + \
rightColumnStr + ' </td>\n' rightColumnStr + ' </td>\n'
tlStr += ' </tr>\n' tlStr += ' </tr>\n'
@ -718,7 +719,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the shares timeline as html """Show the shares timeline as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -737,7 +738,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInbox(cssCache: {}, defaultTimeline: str, def htmlInbox(cssCache: {}, defaultTimeline: str,
@ -755,7 +756,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the inbox as html """Show the inbox as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -774,7 +775,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlBookmarks(cssCache: {}, defaultTimeline: str, def htmlBookmarks(cssCache: {}, defaultTimeline: str,
@ -792,7 +793,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the bookmarks as html """Show the bookmarks as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -811,7 +812,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlEvents(cssCache: {}, defaultTimeline: str, def htmlEvents(cssCache: {}, defaultTimeline: str,
@ -829,7 +830,7 @@ def htmlEvents(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the events as html """Show the events as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -848,7 +849,7 @@ def htmlEvents(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxDMs(cssCache: {}, defaultTimeline: str, def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
@ -866,7 +867,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the DM timeline as html """Show the DM timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -880,7 +881,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
showPublishAsIcon, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxReplies(cssCache: {}, defaultTimeline: str, def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
@ -898,7 +899,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the replies timeline as html """Show the replies timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -913,7 +914,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxMedia(cssCache: {}, defaultTimeline: str, def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
@ -931,7 +932,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the media timeline as html """Show the media timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -946,7 +947,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str, def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
@ -964,7 +965,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the blogs timeline as html """Show the blogs timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -979,7 +980,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str, def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
@ -997,7 +998,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool,
theme: str) -> str:
"""Show the features timeline as html """Show the features timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1012,7 +1014,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlInboxNews(cssCache: {}, defaultTimeline: str, def htmlInboxNews(cssCache: {}, defaultTimeline: str,
@ -1030,7 +1032,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the news timeline as html """Show the news timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1045,7 +1047,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
positiveVoting, showPublishAsIcon, positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, iconsAsButtons, rssIconAtTop, publishButtonAtTop,
authorized, None) authorized, None, theme)
def htmlOutbox(cssCache: {}, defaultTimeline: str, def htmlOutbox(cssCache: {}, defaultTimeline: str,
@ -1063,7 +1065,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
iconsAsButtons: bool, iconsAsButtons: bool,
rssIconAtTop: bool, rssIconAtTop: bool,
publishButtonAtTop: bool, publishButtonAtTop: bool,
authorized: bool) -> str: authorized: bool, theme: str) -> str:
"""Show the Outbox as html """Show the Outbox as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1079,4 +1081,4 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
newswire, False, False, positiveVoting, newswire, False, False, positiveVoting,
showPublishAsIcon, fullWidthTimelineButtonHeader, showPublishAsIcon, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop, 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, 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 returns the filenames for an image with the given name
""" """
@ -484,7 +484,7 @@ def getImageFile(baseDir: str, name: str, directory: str,
bannerFile = '' bannerFile = ''
bannerFilename = '' bannerFilename = ''
for ext in bannerExtensions: for ext in bannerExtensions:
bannerFile = name + '.' + ext bannerFile = name + '_' + theme + '.' + ext
bannerFilename = directory + '/' + bannerFile bannerFilename = directory + '/' + bannerFile
if os.path.isfile(bannerFilename): if os.path.isfile(bannerFilename):
break break
@ -492,31 +492,31 @@ def getImageFile(baseDir: str, name: str, directory: str,
def getBannerFile(baseDir: str, def getBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str): nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'banner', return getImageFile(baseDir, 'banner',
baseDir + '/accounts/' + nickname + '@' + domain, baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain) nickname, domain, theme)
def getSearchBannerFile(baseDir: str, def getSearchBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str): nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'search_banner', return getImageFile(baseDir, 'search_banner',
baseDir + '/accounts/' + nickname + '@' + domain, baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain) nickname, domain, theme)
def getLeftImageFile(baseDir: str, def getLeftImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str): nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'left_col_image', return getImageFile(baseDir, 'left_col_image',
baseDir + '/accounts/' + nickname + '@' + domain, baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain) nickname, domain, theme)
def getRightImageFile(baseDir: str, def getRightImageFile(baseDir: str,
nickname: str, domain: str) -> (str, str): nickname: str, domain: str, theme: str) -> (str, str):
return getImageFile(baseDir, 'right_col_image', return getImageFile(baseDir, 'right_col_image',
baseDir + '/accounts/' + nickname + '@' + domain, baseDir + '/accounts/' + nickname + '@' + domain,
nickname, domain) nickname, domain, theme)
def htmlHeaderWithExternalStyle(cssFilename: str, lang='en') -> str: def htmlHeaderWithExternalStyle(cssFilename: str, lang='en') -> str: