diff --git a/webapp_timeline.py b/webapp_timeline.py
index 8d54ca4e..e8e48e05 100644
--- a/webapp_timeline.py
+++ b/webapp_timeline.py
@@ -69,51 +69,9 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
timelineStartTime = time.time()
- 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##', '')
- calendarPath = calendarPath.replace('\n', '').replace('\r', '')
-
- # should the DM button be highlighted?
- newDM = False
- dmFile = accountDir + '/.newDM'
- if os.path.isfile(dmFile):
- newDM = True
- if boxName == 'dm':
- os.remove(dmFile)
-
- # should the Replies button be highlighted?
- newReply = False
- replyFile = accountDir + '/.newReply'
- if os.path.isfile(replyFile):
- newReply = True
- if boxName == 'tlreplies':
- os.remove(replyFile)
-
- # should the Shares button be highlighted?
- newShare = False
- newShareFile = accountDir + '/.newShare'
- if os.path.isfile(newShareFile):
- newShare = True
- if boxName == 'tlshares':
- os.remove(newShareFile)
-
- # should the Moderation/reports button be highlighted?
- newReport = False
- newReportFile = accountDir + '/.newReport'
- if os.path.isfile(newReportFile):
- newReport = True
- if boxName == 'moderation':
- os.remove(newReportFile)
+ # directory where icons are found
+ # This changes depending upon theme
+ iconsDir = getIconsDir(baseDir)
separatorStr = ''
if boxName != 'tlmedia':
@@ -140,60 +98,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '2')
- # the appearance of buttons - highlighted or not
- inboxButton = 'button'
- blogsButton = 'button'
- featuresButton = 'button'
- newsButton = 'button'
- dmButton = 'button'
- if newDM:
- dmButton = 'buttonhighlighted'
- repliesButton = 'button'
- if newReply:
- repliesButton = 'buttonhighlighted'
- mediaButton = 'button'
- bookmarksButton = 'button'
- eventsButton = 'button'
- sentButton = 'button'
- sharesButton = 'button'
- if newShare:
- sharesButton = 'buttonhighlighted'
- moderationButton = 'button'
- if newReport:
- moderationButton = 'buttonhighlighted'
- if boxName == 'inbox':
- inboxButton = 'buttonselected'
- elif boxName == 'tlblogs':
- blogsButton = 'buttonselected'
- elif boxName == 'tlfeatures':
- featuresButton = 'buttonselected'
- elif boxName == 'tlnews':
- newsButton = 'buttonselected'
- elif boxName == 'dm':
- dmButton = 'buttonselected'
- if newDM:
- dmButton = 'buttonselectedhighlighted'
- elif boxName == 'tlreplies':
- repliesButton = 'buttonselected'
- if newReply:
- repliesButton = 'buttonselectedhighlighted'
- elif boxName == 'tlmedia':
- mediaButton = 'buttonselected'
- elif boxName == 'outbox':
- sentButton = 'buttonselected'
- elif boxName == 'moderation':
- moderationButton = 'buttonselected'
- if newReport:
- moderationButton = 'buttonselectedhighlighted'
- elif boxName == 'tlshares':
- sharesButton = 'buttonselected'
- if newShare:
- sharesButton = 'buttonselectedhighlighted'
- elif boxName == 'tlbookmarks' or boxName == 'bookmarks':
- bookmarksButton = 'buttonselected'
- elif boxName == 'tlevents':
- eventsButton = 'buttonselected'
-
# get the full domain, including any port number
fullDomain = getFullDomain(domain, port)
@@ -202,60 +106,12 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
showIndividualPostIcons = True
- # show an icon for new follow approvals
- followApprovals = ''
- followRequestsFilename = \
- baseDir + '/accounts/' + \
- nickname + '@' + domain + '/followrequests.txt'
- if os.path.isfile(followRequestsFilename):
- with open(followRequestsFilename, 'r') as f:
- for line in f:
- if len(line) > 0:
- # show follow approvals icon
- followApprovals = \
- '' + \
- '\n'
- break
+ # benchmark 3
+ timeDiff = int((time.time() - timelineStartTime) * 1000)
+ if timeDiff > 100:
+ print('TIMELINE TIMING ' + boxName + ' 3 = ' + str(timeDiff))
- _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '3')
-
- # moderation / reports button
- moderationButtonStr = ''
- if moderator and not minimal:
- moderationButtonStr = \
- ''
-
- # shares, bookmarks and events buttons
- sharesButtonStr = ''
- bookmarksButtonStr = ''
- eventsButtonStr = ''
- if not minimal:
- sharesButtonStr = \
- ''
-
- bookmarksButtonStr = \
- ''
-
- eventsButtonStr = \
- ''
-
- tlStr = htmlHeaderWithExternalStyle(cssFilename)
+ tlStr = htmlHeaderWithExternalStyle(cssFilename, profileStyle)
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
@@ -264,133 +120,29 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
if defaultTimeline == 'tlfeatures' and boxName == 'tlfeatures':
newsHeader = True
- newPostButtonStr = ''
- # start of headericons div
- if not newsHeader:
- if not iconsAsButtons:
- newPostButtonStr += '