From 3d879081f7c30bffeea172e03ef0403ec8413191 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Oct 2020 22:00:54 +0000 Subject: [PATCH] News header --- webinterface.py | 129 ++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 58 deletions(-) diff --git a/webinterface.py b/webinterface.py index 9f554840..22970203 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5996,20 +5996,27 @@ def getTimelineButtonHeader(defaultTimeline: str, inboxButton + '">' + \ translate['Inbox'] + '\n' - tlStr += \ - ' \n' + # if this is a news instance and we are viewing the news timeline + newsHeader = False + if defaultTimeline == 'tlnews' and boxName == 'tlnews': + newsHeader = True - tlStr += \ - ' \n' + if not newsHeader: + tlStr += \ + ' \n' + + tlStr += \ + ' \n' # typically the media button if defaultTimeline != 'tlmedia': - if not minimal: + if not minimal and not newsHeader: tlStr += \ ' \n' + if not newsHeader: + tlStr += \ + ' \n' else: if not minimal: tlStr += \ @@ -6049,23 +6057,25 @@ def getTimelineButtonHeader(defaultTimeline: str, newsButton + '">' + translate['News'] + \ '\n' else: + if not newsHeader: + tlStr += \ + ' \n' + + if not newsHeader: + # button for the outbox tlStr += \ ' \n' - # button for the outbox - tlStr += \ - ' \n' - - # add other buttons - tlStr += \ - sharesButtonStr + bookmarksButtonStr + eventsButtonStr + \ - moderationButtonStr + newPostButtonStr + # add other buttons + tlStr += \ + sharesButtonStr + bookmarksButtonStr + eventsButtonStr + \ + moderationButtonStr + newPostButtonStr # show todays events buttons on the first inbox page if boxName == 'inbox' and pageNumber == 1: @@ -6114,20 +6124,21 @@ def getTimelineButtonHeader(defaultTimeline: str, '/calendar">\n' - if not iconsAsButtons: - # the search button - tlStr += \ - ' | ' + \
-            translate['Search and follow'] + '\n' - else: - tlStr += \ - ' \n' + if not newsHeader: + if not iconsAsButtons: + # the search button + tlStr += \ + ' | ' + \
+                translate['Search and follow'] + '\n' + else: + tlStr += \ + ' \n' # benchmark 5 timeDiff = int((time.time() - timelineStartTime) * 1000) @@ -6154,21 +6165,22 @@ def getTimelineButtonHeader(defaultTimeline: str, '' + translate['Calendar'] + \ '\n' - # the show/hide button, for a simpler header appearance - if not iconsAsButtons: - tlStr += \ - ' | ' + translate['Show/Hide Buttons'] + \
-            '\n' - else: - tlStr += \ - ' \n' + if not newsHeader: + # the show/hide button, for a simpler header appearance + if not iconsAsButtons: + tlStr += \ + ' | ' + translate['Show/Hide Buttons'] + \
+                '\n' + else: + tlStr += \ + ' \n' # the newswire button to show right column links if not iconsAsButtons: @@ -6204,7 +6216,8 @@ def getTimelineButtonHeader(defaultTimeline: str, '' + translate['Links'] + \ '\n' - tlStr += followApprovals + if not newsHeader: + tlStr += followApprovals # end of the button header with inbox, outbox, etc tlStr += ' \n' return tlStr