Optional page number

master
Bob Mottram 2019-09-06 10:29:36 +01:00
parent 9fff2ac7fa
commit 25532fb73c
1 changed files with 8 additions and 5 deletions

View File

@ -1630,6 +1630,10 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \
publishedStr=datetimeObject.strftime("%a %b %d, %H:%M") publishedStr=datetimeObject.strftime("%a %b %d, %H:%M")
footerStr='<span class="'+timeClass+'">'+publishedStr+'</span>\n' footerStr='<span class="'+timeClass+'">'+publishedStr+'</span>\n'
pageNumberParam=''
if pageNumber:
pageNumberParam='?page='+str(pageNumber)
announceStr='' announceStr=''
if not isModerationPost and showRepeatIcon: if not isModerationPost and showRepeatIcon:
# don't allow announce/repeat of your own posts # don't allow announce/repeat of your own posts
@ -1641,7 +1645,7 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \
announceLink='unrepeat' announceLink='unrepeat'
announceTitle='Undo the repeat this post' announceTitle='Undo the repeat this post'
announceStr= \ announceStr= \
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+'?page='+str(pageNumber)+'" title="'+announceTitle+'">' \ '<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+announceTitle+'">' \
'<img src="/icons/'+announceIcon+'"/></a>' '<img src="/icons/'+announceIcon+'"/></a>'
likeStr='' likeStr=''
@ -1654,7 +1658,7 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \
likeLink='unlike' likeLink='unlike'
likeTitle='Undo the like of this post' likeTitle='Undo the like of this post'
likeStr= \ likeStr= \
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+'?page='+str(pageNumber)+'" title="'+likeTitle+'">' \ '<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+likeTitle+'">' \
'<img src="/icons/'+likeIcon+'"/></a>' '<img src="/icons/'+likeIcon+'"/></a>'
deleteStr='' deleteStr=''
@ -1663,7 +1667,7 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \
postJsonObject['object']['id'].startswith(postJsonObject['actor'])): postJsonObject['object']['id'].startswith(postJsonObject['actor'])):
if '/users/'+nickname+'/' in postJsonObject['object']['id']: if '/users/'+nickname+'/' in postJsonObject['object']['id']:
deleteStr= \ deleteStr= \
'<a href="/users/'+nickname+'?delete='+postJsonObject['object']['id']+'?page='+str(pageNumber)+'" title="Delete this post">' \ '<a href="/users/'+nickname+'?delete='+postJsonObject['object']['id']+pageNumberParam+'" title="Delete this post">' \
'<img src="/icons/delete.png"/></a>' '<img src="/icons/delete.png"/></a>'
# change the background color for DMs in inbox timeline # change the background color for DMs in inbox timeline
@ -1683,8 +1687,7 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \
replyToLink+='?mention='+actorUrl replyToLink+='?mention='+actorUrl
if len(replyToLink)>500: if len(replyToLink)>500:
break break
if pageNumber: replyToLink+=pageNumberParam
replyToLink+='?page='+str(pageNumber)
footerStr='<div class="'+containerClassIcons+'">' footerStr='<div class="'+containerClassIcons+'">'
if not isModerationPost and showRepeatIcon: if not isModerationPost and showRepeatIcon: