diff --git a/webinterface.py b/webinterface.py index ad1c609bd..7210c7a66 100644 --- a/webinterface.py +++ b/webinterface.py @@ -4189,6 +4189,17 @@ def isQuestion(postObjectJson: {}) -> bool: return True +def htmlHighlightLabel(label: str, highlight: bool) -> str: + """If the give text should be highlighted then return + the appropriate markup. + This is so that in shell browsers, like lynx, it's possible + to see if the replies or DM button are highlighted. + """ + if not highlight: + return label + return '' + label + '' + + def htmlTimeline(defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, translate: {}, pageNumber: int, @@ -4204,10 +4215,12 @@ def htmlTimeline(defaultTimeline: str, accountDir = baseDir + '/accounts/' + nickname + '@' + domain # should the calendar icon be highlighted? + newCalendarEvent = False calendarImage = 'calendar.png' calendarPath = '/calendar' calendarFile = accountDir + '/.newCalendar' if os.path.isfile(calendarFile): + newCalendarEvent = True calendarImage = 'calendar_notify.png' with open(calendarFile, 'r') as calfile: calendarPath = calfile.read().replace('##sent##', '') @@ -4352,14 +4365,16 @@ def htmlTimeline(defaultTimeline: str, '' + htmlHighlightLabel(translate['Mod'], newReport) + \ + ' ' sharesButtonStr = '' bookmarksButtonStr = '' if not minimal: sharesButtonStr = \ '' bookmarksButtonStr = \ @@ -4441,10 +4456,13 @@ def htmlTimeline(defaultTimeline: str, tlStr += \ ' ' + '">' + htmlHighlightLabel(translate['DM'], newDM) + \ + '' + tlStr += \ ' ' # typically the media button @@ -4493,12 +4511,17 @@ def htmlTimeline(defaultTimeline: str, iconsDir + '/search.png" title="' + \ translate['Search and follow'] + '" alt="' + \ translate['Search and follow'] + '" class="timelineicon"/>' + + calendarAltText = translate['Calendar'] + if newCalendarEvent: + # indicate that the calendar icon is highlighted + calendarAltText = '*' + calendarAltText + '*' tlStr += \ ' ' + translate['Calendar'] + \
-        '' + '" alt="' + calendarAltText + '" class="timelineicon"/>' + tlStr += \ '