Don't show calendar in features timeline

main
Bob Mottram 2020-10-27 18:14:58 +00:00
parent 73b38b0b3a
commit 35598b9e48
1 changed files with 42 additions and 37 deletions

View File

@ -6042,25 +6042,29 @@ def getTimelineButtonHeader(defaultTimeline: str,
inboxButton+'"><span>' + translate['Inbox'] + \ inboxButton+'"><span>' + translate['Inbox'] + \
'</span></button></a>\n' '</span></button></a>\n'
# typically the blogs button isFeaturesTimeline = \
# but may change if this is a blogging oriented instance defaultTimeline == 'tlnews' and boxName != 'tlnews'
if defaultTimeline != 'tlblogs':
if not minimal: if not isFeaturesTimeline:
titleStr = translate['Blogs'] # typically the blogs button
if defaultTimeline == 'tlnews': # but may change if this is a blogging oriented instance
titleStr = translate['Article'] if defaultTimeline != 'tlblogs':
tlStr += \ if not minimal and not isFeaturesTimeline:
' <a href="' + usersPath + \ titleStr = translate['Blogs']
'/tlblogs"><button class="' + \ if defaultTimeline == 'tlnews':
blogsButton + '"><span>' + titleStr + \ titleStr = translate['Article']
'</span></button></a>\n' tlStr += \
else: ' <a href="' + usersPath + \
if not minimal: '/tlblogs"><button class="' + \
tlStr += \ blogsButton + '"><span>' + titleStr + \
' <a href="' + usersPath + \ '</span></button></a>\n'
'/inbox"><button class="' + \ else:
inboxButton + '"><span>' + translate['Inbox'] + \ if not minimal:
'</span></button></a>\n' tlStr += \
' <a href="' + usersPath + \
'/inbox"><button class="' + \
inboxButton + '"><span>' + translate['Inbox'] + \
'</span></button></a>\n'
# typically the news button # typically the news button
# but may change if this is a news oriented instance # but may change if this is a news oriented instance
@ -6161,24 +6165,25 @@ def getTimelineButtonHeader(defaultTimeline: str,
print('TIMELINE TIMING ' + boxName + ' 5 = ' + str(timeDiff)) print('TIMELINE TIMING ' + boxName + ' 5 = ' + str(timeDiff))
# the calendar button # the calendar button
calendarAltText = translate['Calendar'] if not isFeaturesTimeline:
if newCalendarEvent: calendarAltText = translate['Calendar']
# indicate that the calendar icon is highlighted if newCalendarEvent:
calendarAltText = '*' + calendarAltText + '*' # indicate that the calendar icon is highlighted
if not iconsAsButtons: calendarAltText = '*' + calendarAltText + '*'
tlStr += \ if not iconsAsButtons:
' <a class="imageAnchor" href="' + \ tlStr += \
usersPath + calendarPath + \ ' <a class="imageAnchor" href="' + \
'"><img loading="lazy" src="/' + iconsDir + '/' + \ usersPath + calendarPath + \
calendarImage + '" title="' + translate['Calendar'] + \ '"><img loading="lazy" src="/' + iconsDir + '/' + \
'" alt="| ' + calendarAltText + \ calendarImage + '" title="' + translate['Calendar'] + \
'" class="timelineicon"/></a>\n' '" alt="| ' + calendarAltText + \
else: '" class="timelineicon"/></a>\n'
tlStr += \ else:
' <a href="' + usersPath + calendarPath + \ tlStr += \
'"><button class="button">' + \ ' <a href="' + usersPath + calendarPath + \
'<span>' + translate['Calendar'] + \ '"><button class="button">' + \
'</span></button></a>\n' '<span>' + translate['Calendar'] + \
'</span></button></a>\n'
if not newsHeader: if not newsHeader:
# the show/hide button, for a simpler header appearance # the show/hide button, for a simpler header appearance