From 0f1b6c4367fcdf59c14c3e4564916780099dfdf9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Sep 2019 17:37:33 +0100 Subject: [PATCH] Add page number --- webinterface.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webinterface.py b/webinterface.py index 95363487..72d77334 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1374,15 +1374,18 @@ def followerApprovalActive(baseDir: str,nickname: str,domain: str) -> bool: manuallyApprovesFollowers=actorJson['manuallyApprovesFollowers'] return manuallyApprovesFollowers -def insertQuestion(nickname: str,content: str,postJsonObject: {}) -> str: +def insertQuestion(nickname: str,content: str,postJsonObject: {},pageNumber: int) -> str: """ Inserts question selection into a post """ if not isQuestion(postJsonObject): return content if len(postJsonObject['object']['oneOf'])==0: return content + pageNumberStr='' + if pageNumber: + pageNumberStr='?page='+str(pageNumber) content+='
' - content+='
' + content+='' content+='' for choice in postJsonObject['object']['oneOf']: if not choice.get('type'): @@ -1725,7 +1728,7 @@ def individualPostAsHtml(pageNumber: int,baseDir: str, \ if not postJsonObject['object']['sensitive']: contentStr=postJsonObject['object']['content']+attachmentStr contentStr=addEmbeddedElements(contentStr) - contentStr=insertQuestion(nickname,contentStr,postJsonObject) + contentStr=insertQuestion(nickname,contentStr,postJsonObject,pageNumber) else: postID='post'+str(createPassword(8)) contentStr=''