Adapt to changes from recent merges ['tlfeatures']

alt-html-css
Admin 2020-12-03 09:54:35 +00:00
parent bd0c75ed7b
commit 66a96015cd
1 changed files with 19 additions and 13 deletions

View File

@ -125,6 +125,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
if timeDiff > 100: if timeDiff > 100:
print('TIMELINE TIMING ' + boxName + ' 3 = ' + str(timeDiff)) print('TIMELINE TIMING ' + boxName + ' 3 = ' + str(timeDiff))
# NOTE: This uses a variant function for multiple CSS files
# TODO: Figure out a better approach
tlStr = htmlHeaderWithExternalStyles(cssFiles) tlStr = htmlHeaderWithExternalStyles(cssFiles)
# benchmark 4 # benchmark 4
@ -134,9 +136,9 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4') _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
# if this is a news instance and we are viewing the news timeline # if this is a 'News' instance and we are viewing the features timeline
newsHeader = False newsHeader = False
if defaultTimeline == 'tlfeatures' and boxName == 'tlfeatures': if defaultTimeline == 'tlfeatures':# and boxName == 'tlfeatures':
newsHeader = True newsHeader = True
# Banner and "profile toggle" link # Banner and "profile toggle" link
@ -153,8 +155,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
else: else:
# TODO: News instances should ignore personalised banners # TODO: News instances should ignore personalised banners
# Currently uses the 'news' actor banner - as it remains unchanged # Currently uses the 'news' actor banner - as it remains unchanged
tlStr += (f"\t<a class=\"timeline-banner hidden-text\" href=\"/tlnews\">" tlStr += (f"\t<a class=\"timeline-banner hidden-text\" href=\"/users/{nickname}/tlfeatures\">"
f"{translate['News']}</a>\n" f"{translate['Features']}</a>\n"
f"\t<div class=\"title\">\n" f"\t<div class=\"title\">\n"
f"\t\t<span>#IndymediaBack</span>\n" f"\t\t<span>#IndymediaBack</span>\n"
f"\t</div>\n") f"\t</div>\n")
@ -164,14 +166,15 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
# Certain Epciyon pages should only be accessible via the 'User' page for News instances # Certain Epciyon pages should only be accessible via the 'User' page for News instances
# TODO: The 'new...' pages appear to require handling elsewhere
userPages = ['inbox', 'outbox', 'dm', 'tlreplies', 'tlblogs', 'tlmedia', 'tlshares', \ userPages = ['inbox', 'outbox', 'dm', 'tlreplies', 'tlblogs', 'tlmedia', 'tlshares', \
'tlsaves', 'tlevents', 'tlbookmarks', 'moderation', 'search', \ 'tlsaves', 'tlevents', 'tlbookmarks', 'moderation', 'search', \
'followers', 'newfollowers'] 'followers', 'newfollowers', 'newdm', 'newpost', 'newblog', 'newevent']
# Full row "navbar" # Full row "navbar"
if defaultTimeline == 'tlnews': if defaultTimeline == 'tlfeatures':
# Show "tab" links instead of standard "buttons" # Show "tab" links instead of standard "buttons"
tlStr += headerNewsTabs(boxName, translate, usersPath, moderator, baseDir, userPages) tlStr += headerNewsTabs(boxName, translate, usersPath, baseDir, userPages)
# Close banner div # Close banner div
tlStr += '</div>\n' tlStr += '</div>\n'
@ -187,15 +190,18 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
manuallyApproveFollowers, manuallyApproveFollowers,
baseDir, nickname, baseDir, nickname,
domain, timelineStartTime, domain, timelineStartTime,
iconsAsButtons) iconsAsButtons, userPages)
else:
# Close banner div
tlStr += '</div>\n'
# start the timeline # start the timeline
tlStr += '<div class="timeline">\n' tlStr += '<div class="timeline">\n'
domainFull = getFullDomain(domain, port) domainFull = getFullDomain(domain, port)
# Only show standard "buttons" on 'inbox' page # For 'News' instances, only show standard "buttons" on "user" pages
if defaultTimeline == 'tlnews' and boxName in userPages: if defaultTimeline == 'tlfeatures' and boxName in userPages:
tlStr += \ tlStr += \
headerButtonsTimeline(defaultTimeline, boxName, pageNumber, headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, translate, usersPath,
@ -218,7 +224,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
# center column containing posts # center column containing posts
tlStr += ' <div class="section main">\n' tlStr += ' <div class="section main">\n'
if not defaultTimeline == 'tlnews' and not fullWidthTimelineButtonHeader: if not defaultTimeline == 'tlfeatures' and not fullWidthTimelineButtonHeader:
tlStr += \ tlStr += \
headerButtonsTimeline(defaultTimeline, boxName, pageNumber, headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, translate, usersPath,
@ -226,7 +232,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
manuallyApproveFollowers, manuallyApproveFollowers,
baseDir, nickname, baseDir, nickname,
domain, timelineStartTime, domain, timelineStartTime,
iconsAsButtons) iconsAsButtons, userPages)
# second row of buttons for moderator actions # second row of buttons for moderator actions
if moderator and boxName == 'moderation': if moderator and boxName == 'moderation':
@ -399,7 +405,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
# end of column-center # end of column-center
tlStr += ' </div>\n' tlStr += ' </div>\n'
if defaultTimeline == 'tlnews' and boxName not in userPages: if defaultTimeline == 'tlfeatures' and boxName not in userPages:
# right column # right column
rightColumnStr = getRightColumnContent(baseDir, nickname, domainFull, rightColumnStr = getRightColumnContent(baseDir, nickname, domainFull,
httpPrefix, translate, iconsPath, httpPrefix, translate, iconsPath,