Links on calendar

main2
Bob Mottram 2019-10-11 20:12:30 +01:00
parent 6f8a86a044
commit eb2e76b57b
2 changed files with 7 additions and 6 deletions

View File

@ -1057,7 +1057,8 @@ class PubServer(BaseHTTPRequestHandler):
if '/calendar' in self.path: if '/calendar' in self.path:
# show the calendar screen # show the calendar screen
msg=htmlCalendar(self.server.translate, \ msg=htmlCalendar(self.server.translate, \
self.server.baseDir,self.path).encode() self.server.baseDir,self.path, \
self.server.domain).encode()
self._set_headers('text/html',len(msg),cookie) self._set_headers('text/html',len(msg),cookie)
self.wfile.write(msg) self.wfile.write(msg)
self.server.GETbusy=False self.server.GETbusy=False

View File

@ -2847,7 +2847,7 @@ def htmlCalendarDay(translate: {}, \
return calendarStr return calendarStr
def htmlCalendar(translate: {}, \ def htmlCalendar(translate: {}, \
baseDir: str,path: str) -> str: baseDir: str,path: str,domain: str) -> str:
"""Show the calendar for a person """Show the calendar for a person
""" """
monthNumber=0 monthNumber=0
@ -2880,8 +2880,6 @@ def htmlCalendar(translate: {}, \
monthNumber=currDate.month monthNumber=currDate.month
nickname=getNicknameFromActor(actor) nickname=getNicknameFromActor(actor)
domain,port=getDomainFromActor(actor)
events=getCalendarEvents(baseDir,nickname,domain,year,monthNumber) events=getCalendarEvents(baseDir,nickname,domain,year,monthNumber)
months=['Jaruary','February','March','April','May','June','July','August','September','October','November','December'] months=['Jaruary','February','March','April','May','June','July','August','September','October','November','December']
@ -2968,11 +2966,13 @@ def htmlCalendar(translate: {}, \
eventDots+='.' eventDots+='.'
if eventDots=='...': if eventDots=='...':
break break
url=actor+'?year='+str(year)+'?month='+str(monthNumber)+'?day='+str(dayOfMonth)
dayLink='<a href="'+url+'">'+str(dayOfMonth)+'</a>'
# there are events for this day # there are events for this day
if not isToday: if not isToday:
calendarStr+=' <td class="calendar__day__cell" data-event="'+eventDots+'">'+str(dayOfMonth)+'</td>\n' calendarStr+=' <td class="calendar__day__cell" data-event="'+eventDots+'">'+dayLink+'</td>\n'
else: else:
calendarStr+=' <td class="calendar__day__cell" data-today-event="'+eventDots+'">'+str(dayOfMonth)+'</td>\n' calendarStr+=' <td class="calendar__day__cell" data-today-event="'+eventDots+'">'+dayLink+'</td>\n'
else: else:
# No events today # No events today
if not isToday: if not isToday: