main
Bob Mottram 2020-10-31 10:16:30 +00:00
parent 98ae8c40b5
commit b8032e0938
1 changed files with 102 additions and 102 deletions

View File

@ -3298,55 +3298,6 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
return timelineStr
def headerButtonsFrontScreen(translate: {},
nickname: str, boxName: str,
authorized: bool) -> str:
"""Returns the header buttons for the front page of a news instance
"""
headerStr = ' <div class="frontPageMobileButtons">\n'
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 += \
' <a href="/">' + \
'<button class="' + buttonFeatures + '">' + \
'<span>' + translate['Features'] + \
'</span></button></a>\n'
if not authorized:
headerStr += \
' <a href="/login">' + \
'<button class="buttonMobile">' + \
'<span>' + translate['Login'] + \
'</span></button></a>\n'
headerStr += \
' <a href="/users/news/newswiremobile">' + \
'<button class="' + buttonNewswire + '">' + \
'<span>' + translate['Newswire'] + \
'</span></button></a>\n'
headerStr += \
' <a href="/users/news/linksmobile">' + \
'<button class="' + buttonLinks + '">' + \
'<span>' + translate['Links'] + \
'</span></button></a>\n'
else:
if not authorized:
headerStr += \
' <a href="/login' + \
'"><button class="buttonMobile">' + \
'<span>' + translate['Login'] + \
'</span></button></a>\n'
headerStr += ' </div>\n'
return headerStr
def htmlProfile(cssCache: {}, iconsAsButtons: bool,
defaultTimeline: str,
recentPostsCache: {}, maxRecentPosts: int,
@ -6060,7 +6011,56 @@ def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
return bannerFile, bannerFilename
def getTimelineButtonHeader(defaultTimeline: str,
def headerButtonsFrontScreen(translate: {},
nickname: str, boxName: str,
authorized: bool) -> str:
"""Returns the header buttons for the front page of a news instance
"""
headerStr = ' <div class="frontPageMobileButtons">\n'
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 += \
' <a href="/">' + \
'<button class="' + buttonFeatures + '">' + \
'<span>' + translate['Features'] + \
'</span></button></a>\n'
if not authorized:
headerStr += \
' <a href="/login">' + \
'<button class="buttonMobile">' + \
'<span>' + translate['Login'] + \
'</span></button></a>\n'
headerStr += \
' <a href="/users/news/newswiremobile">' + \
'<button class="' + buttonNewswire + '">' + \
'<span>' + translate['Newswire'] + \
'</span></button></a>\n'
headerStr += \
' <a href="/users/news/linksmobile">' + \
'<button class="' + buttonLinks + '">' + \
'<span>' + translate['Links'] + \
'</span></button></a>\n'
else:
if not authorized:
headerStr += \
' <a href="/login' + \
'"><button class="buttonMobile">' + \
'<span>' + translate['Login'] + \
'</span></button></a>\n'
headerStr += ' </div>\n'
return headerStr
def headerButtonsTimeline(defaultTimeline: str,
boxName: str,
pageNumber: int,
translate: {},
@ -6695,7 +6695,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
if fullWidthTimelineButtonHeader:
tlStr += \
getTimelineButtonHeader(defaultTimeline, boxName, pageNumber,
headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, mediaButton,
blogsButton, newsButton, inboxButton,
dmButton, newDM, repliesButton,
@ -6736,7 +6736,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
if not fullWidthTimelineButtonHeader:
tlStr += \
getTimelineButtonHeader(defaultTimeline, boxName, pageNumber,
headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, mediaButton,
blogsButton, newsButton, inboxButton,
dmButton, newDM, repliesButton,