From 8736b8e9556343d66b8c658c6733dd86d79a7b48 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Aug 2019 15:14:12 +0100 Subject: [PATCH] Optional custom message within report header --- webinterface.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index cc7a9067..081b3cfa 100644 --- a/webinterface.py +++ b/webinterface.py @@ -331,8 +331,18 @@ def htmlNewPost(baseDir: str,path: str,inReplyTo: str,mentions: []) -> str: replyStr='' else: newPostText= \ - '

Enter your report below.

' \ - '

This message only goes to moderators, even if it mentions other fediverse addresses.

' + '

Enter your report below.

' + + # custom report header with any additional instructions + if os.path.isfile(baseDir+'/accounts/report.txt'): + with open(baseDir+'/accounts/report.txt', 'r') as file: + customReportText=file.read() + if '

' not in customReportText: + customReportText='

'+customReportText+'

' + customReportText=customReportText.replace('

','

') + newPostText+=customReportText + + newPostText+='

This message only goes to moderators, even if it mentions other fediverse addresses.

You can also refer to points within the Terms of Service if necessary.

' else: newPostText='

Enter the details for your shared item below.

'