From 51d8b9fbe25a4f64383669e94f2e2c4ccdeb9c98 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 11 Jul 2020 18:45:45 +0100 Subject: [PATCH] Calendar relative path --- webinterface.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/webinterface.py b/webinterface.py index b57c388c..53b63e60 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5829,20 +5829,24 @@ def htmlCalendar(translate: {}, with open(cssFilename, 'r') as cssFile: calendarStyle = cssFile.read() + calActor = actor + if '/users/' in actor: + calActor = '/users/' + actor.split('/users/')[1] + calendarStr = htmlHeader(cssFilename, calendarStyle) calendarStr += '
\n' calendarStr += '
\n' calendarStr += \ - ' ' calendarStr += \ ' ' + translate['Previous month'] + \
         '\n' - calendarStr += ' ' + calendarStr += ' ' calendarStr += '

' + monthName + '

\n' calendarStr += \ - ' ' calendarStr += \ ' ' + translate['Next month'] + \
@@ -5884,7 +5888,7 @@ def htmlCalendar(translate: {},
                         if dayOfMonth == currDate.day:
                             isToday = True
                 if events.get(str(dayOfMonth)):
-                    url = actor + '/calendar?year=' + str(year) + '?month=' + \
+                    url = calActor + '/calendar?year=' + str(year) + '?month=' + \
                         str(monthNumber) + '?day=' + str(dayOfMonth)
                     dayLink = '<a href=' + \ str(dayOfMonth) + ''