Include date when confirming deletion of calendar events

merge-requests/6/head
Bob Mottram 2020-02-23 13:07:30 +00:00
parent 7d5800fd1b
commit 13afcca48f
2 changed files with 15 additions and 4 deletions

View File

@ -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+ \

View File

@ -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+='<center><h1>'+postTime+'</h1></center>'
deletePostStr+='<center><h1>'+postTime+' '+str(year)+'/'+str(monthNumber)+'/'+str(dayNumber)+'</h1></center>'
deletePostStr+='<center>'
deletePostStr+=' <p class="followText">'+translate['Delete this event']+'</p>'
deletePostStr+=' <form method="POST" action="'+actor+'/rmpost">'
deletePostStr+=' <input type="hidden" name="pageNumber" value="1">'
deletePostStr+=' <input type="hidden" name="messageId" value="'+messageId+'">'
deletePostStr+=' <button type="submit" class="button" name="submitYes">'+translate['Yes']+'</button>'
deletePostStr+=' <a href="'+actor+'/calendar'+'"><button class="button">'+translate['No']+'</button></a>'
deletePostStr+=' <a href="'+actor+'/calendar?year='+str(year)+'?month='+str(monthNumber)+'"><button class="button">'+translate['No']+'</button></a>'
deletePostStr+=' </form>'
deletePostStr+='</center>'
deletePostStr+=htmlFooter()