From 66a96015cdbd492ab96f0301e2ddb50b3bbd956c Mon Sep 17 00:00:00 2001 From: OMN Date: Thu, 3 Dec 2020 09:54:35 +0000 Subject: [PATCH] Adapt to changes from recent merges ['tlfeatures'] --- webapp_timeline.py | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/webapp_timeline.py b/webapp_timeline.py index 2536d263..21eff3fe 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -125,6 +125,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, if timeDiff > 100: 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) # benchmark 4 @@ -134,9 +136,9 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, _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 - if defaultTimeline == 'tlfeatures' and boxName == 'tlfeatures': + if defaultTimeline == 'tlfeatures':# and boxName == 'tlfeatures': newsHeader = True # Banner and "profile toggle" link @@ -153,8 +155,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, else: # TODO: News instances should ignore personalised banners # Currently uses the 'news' actor banner - as it remains unchanged - tlStr += (f"\t" - f"{translate['News']}\n" + tlStr += (f"\t" + f"{translate['Features']}\n" f"\t
\n" f"\t\t#IndymediaBack\n" f"\t
\n") @@ -164,14 +166,15 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, # 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', \ 'tlsaves', 'tlevents', 'tlbookmarks', 'moderation', 'search', \ - 'followers', 'newfollowers'] + 'followers', 'newfollowers', 'newdm', 'newpost', 'newblog', 'newevent'] # Full row "navbar" - if defaultTimeline == 'tlnews': + if defaultTimeline == 'tlfeatures': # 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 tlStr += '\n' @@ -187,15 +190,18 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, manuallyApproveFollowers, baseDir, nickname, domain, timelineStartTime, - iconsAsButtons) + iconsAsButtons, userPages) + else: + # Close banner div + tlStr += '\n' # start the timeline tlStr += '
\n' domainFull = getFullDomain(domain, port) - # Only show standard "buttons" on 'inbox' page - if defaultTimeline == 'tlnews' and boxName in userPages: + # For 'News' instances, only show standard "buttons" on "user" pages + if defaultTimeline == 'tlfeatures' and boxName in userPages: tlStr += \ headerButtonsTimeline(defaultTimeline, boxName, pageNumber, translate, usersPath, @@ -218,7 +224,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, # center column containing posts tlStr += '
\n' - if not defaultTimeline == 'tlnews' and not fullWidthTimelineButtonHeader: + if not defaultTimeline == 'tlfeatures' and not fullWidthTimelineButtonHeader: tlStr += \ headerButtonsTimeline(defaultTimeline, boxName, pageNumber, translate, usersPath, @@ -226,7 +232,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, manuallyApproveFollowers, baseDir, nickname, domain, timelineStartTime, - iconsAsButtons) + iconsAsButtons, userPages) # second row of buttons for moderator actions if moderator and boxName == 'moderation': @@ -399,7 +405,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, # end of column-center tlStr += '
\n' - if defaultTimeline == 'tlnews' and boxName not in userPages: + if defaultTimeline == 'tlfeatures' and boxName not in userPages: # right column rightColumnStr = getRightColumnContent(baseDir, nickname, domainFull, httpPrefix, translate, iconsPath,