diff --git a/webapp_column_right.py b/webapp_column_right.py index 502c51b9..89754612 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -14,6 +14,7 @@ from utils import locatePost from utils import loadJson from utils import votesOnNewswireItem from utils import getNicknameFromActor +from utils import getConfigParam from utils import isEditor from posts import isModerator from webapp_utils import getRightImageFile diff --git a/webapp_headerbuttons.py b/webapp_headerbuttons.py index 8e7799fe..d36bc4f8 100644 --- a/webapp_headerbuttons.py +++ b/webapp_headerbuttons.py @@ -20,22 +20,9 @@ def headerButtonsTimeline(defaultTimeline: str, pageNumber: int, translate: {}, usersPath: str, - mediaButton: str, - blogsButton: str, - featuresButton: str, - newsButton: str, - inboxButton: str, - dmButton: str, - newDM: str, - repliesButton: str, - newReply: str, minimal: bool, - sentButton: str, - sharesButtonStr: str, - bookmarksButtonStr: str, - eventsButtonStr: str, - moderationButtonStr: str, - newPostButtonStr: str, + moderator: bool, + manuallyApproveFollowers: bool, baseDir: str, nickname: str, domain: str, timelineStartTime, @@ -44,6 +31,53 @@ def headerButtonsTimeline(defaultTimeline: str, """Returns the header at the top of the timeline, containing buttons for inbox, outbox, search, calendar, etc """ + + 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) + # start of the button header with inbox, outbox, etc # TODO: [rename] containerHeader -> menu (or similar) diff --git a/webapp_timeline.py b/webapp_timeline.py index be03aa7e..fc481859 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -185,7 +185,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, getLeftColumnContent(baseDir, nickname, domainFull, httpPrefix, translate, editor, False, None, rssIconAtTop, - True, False) + True, False, theme) tlStr += '