diff --git a/daemon.py b/daemon.py index d79b2f44b..b1c30a742 100644 --- a/daemon.py +++ b/daemon.py @@ -11472,7 +11472,8 @@ class PubServer(BaseHTTPRequestHandler): if htmlGET and usersInPath: if '/calendar' in self.path: # show the calendar screen - msg = htmlCalendar(self.server.cssCache, + msg = htmlCalendar(self.server.personCache, + self.server.cssCache, self.server.translate, self.server.baseDir, self.path, self.server.httpPrefix, diff --git a/webapp_calendar.py b/webapp_calendar.py index 025614e79..5851abda6 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -10,6 +10,7 @@ import os from datetime import datetime from datetime import date from shutil import copyfile +from utils import getDisplayName from utils import getConfigParam from utils import getNicknameFromActor from utils import getDomainFromActor @@ -94,7 +95,7 @@ def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, baseDir: str, return deletePostStr -def _htmlCalendarDay(cssCache: {}, translate: {}, +def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {}, baseDir: str, path: str, year: int, monthNumber: int, dayNumber: int, nickname: str, domain: str, dayEvents: [], @@ -134,6 +135,12 @@ def _htmlCalendarDay(cssCache: {}, translate: {}, eventDescription = None eventPlace = None postId = None + # get display name from sending actor + senderName = '' + if eventPost.get('actor'): + actor = eventPost['actor'] + senderName = '' + \ + getDisplayName(baseDir, actor, personCache) + ': ' # get the time place and description for ev in eventPost: if ev['type'] == 'Event': @@ -145,7 +152,7 @@ def _htmlCalendarDay(cssCache: {}, translate: {}, "%Y-%m-%dT%H:%M:%S%z") eventTime = eventDate.strftime("%H:%M").strip() if ev.get('name'): - eventDescription = ev['name'].strip() + eventDescription = senderName + ev['name'].strip() elif ev['type'] == 'Place': if ev.get('name'): eventPlace = ev['name'] @@ -200,7 +207,7 @@ def _htmlCalendarDay(cssCache: {}, translate: {}, return calendarStr -def htmlCalendar(cssCache: {}, translate: {}, +def htmlCalendar(personCache: {}, cssCache: {}, translate: {}, baseDir: str, path: str, httpPrefix: str, domainFull: str, textModeBanner: str) -> str: @@ -259,7 +266,8 @@ def htmlCalendar(cssCache: {}, translate: {}, if events: if events.get(str(dayNumber)): dayEvents = events[str(dayNumber)] - return _htmlCalendarDay(cssCache, translate, baseDir, path, + return _htmlCalendarDay(personCache, cssCache, + translate, baseDir, path, year, monthNumber, dayNumber, nickname, domain, dayEvents, monthName, actor) diff --git a/webapp_profile.py b/webapp_profile.py index b5398be0d..272719eb5 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1757,7 +1757,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, # danger zone section editProfileForm += '
' + \ - translate['Danger Zone'] + '\n' + translate['Danger Zone'] + '\n' editProfileForm += '
\n' editProfileForm += '
\n'