From 13afcca48fc3b0c12856733e8df9218c43ad6b49 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 23 Feb 2020 13:07:30 +0000 Subject: [PATCH] Include date when confirming deletion of calendar events --- daemon.py | 12 +++++++++++- webinterface.py | 7 ++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 97349f5a..43f485c2 100644 --- a/daemon.py +++ b/daemon.py @@ -1531,12 +1531,22 @@ class PubServer(BaseHTTPRequestHandler): postTime=self.path.split('?time=')[1] if '?' in postTime: postTime=postTime.split('?')[0] + postYear=self.path.split('?year=')[1] + if '?' in postYear: + postYear=postYear.split('?')[0] + postMonth=self.path.split('?month=')[1] + if '?' in postMonth: + postMonth=postMonth.split('?')[0] + postDay=self.path.split('?day=')[1] + if '?' in postDay: + postDay=postDay.split('?')[0] # show the confirmation screen screen msg=htmlCalendarDeleteConfirm(self.server.translate, \ self.server.baseDir,self.path, \ self.server.httpPrefix, \ self.server.domainFull, - postId,postTime) + postId,postTime, \ + postYear,postMonth,postDay) if not msg: actor= \ self.server.httpPrefix+'://'+self.server.domainFull+ \ diff --git a/webinterface.py b/webinterface.py index e4672103..15e13585 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3364,7 +3364,8 @@ def htmlDeletePost(recentPostsCache: {},maxRecentPosts: int, \ def htmlCalendarDeleteConfirm(translate: {},baseDir: str, \ path: str,httpPrefix: str, \ - domainFull: str,postId: str,postTime: str) -> str: + domainFull: str,postId: str,postTime: str, \ + year: int, monthNumber: int, dayNumber: int) -> str: """Shows a screen asking to confirm the deletion of a calendar event """ iconsDir=getIconsDir(baseDir) @@ -3395,14 +3396,14 @@ def htmlCalendarDeleteConfirm(translate: {},baseDir: str, \ if httpPrefix!='https': profileStyle=profileStyle.replace('https://',httpPrefix+'://') deletePostStr=htmlHeader(cssFilename,profileStyle) - deletePostStr+='

'+postTime+'

' + deletePostStr+='

'+postTime+' '+str(year)+'/'+str(monthNumber)+'/'+str(dayNumber)+'

' deletePostStr+='
' deletePostStr+='

'+translate['Delete this event']+'

' deletePostStr+='
' deletePostStr+=' ' deletePostStr+=' ' deletePostStr+=' ' - deletePostStr+=' ' + deletePostStr+=' ' deletePostStr+='
' deletePostStr+='
' deletePostStr+=htmlFooter()