diff --git a/daemon.py b/daemon.py index 9367cc30..72f054fc 100644 --- a/daemon.py +++ b/daemon.py @@ -90,6 +90,7 @@ from webinterface import htmlProfileAfterSearch from webinterface import htmlEditProfile from webinterface import htmlTermsOfService from webinterface import htmlHashtagSearch +from webinterface import htmlModerationInfo from shares import getSharesFeedForPerson from shares import outboxShareUpload from shares import outboxUndoShareUpload @@ -2118,6 +2119,11 @@ class PubServer(BaseHTTPRequestHandler): if '=' in moderationStr: moderationText=moderationStr.split('=')[1].strip() moderationText=moderationText.replace('+',' ').replace('%40','@').replace('%3A',':').replace('%23','#').strip() + elif moderationStr.startswith('submitInfo'): + self._login_headers('text/html') + self.wfile.write(htmlModerationInfo(self.server.baseDir).encode('utf-8')) + self.server.POSTbusy=False + return elif moderationStr.startswith('submitBlock'): moderationButton='block' elif moderationStr.startswith('submitUnblock'): diff --git a/webinterface.py b/webinterface.py index 6c77caa7..2236c3b2 100644 --- a/webinterface.py +++ b/webinterface.py @@ -35,16 +35,42 @@ from content import getMentionsFromHtml from config import getConfigParam from skills import getSkills -def noOfModerationPosts(baseDir: str) -> int: - """Returns the number of posts addressed to moderators - """ - moderationIndexFile=baseDir+'/accounts/moderation.txt' - if not os.path.isfile(moderationIndexFile): - return 0 - with open(moderationIndexFile, "r") as f: - lines = f.readlines() - return len(lines) - return 0 +def htmlModerationInfo(baseDir: str) -> str: + infoForm='' + with open(baseDir+'/epicyon-profile.css', 'r') as cssFile: + infoCSS=cssFile.read() + infoForm=htmlHeader(infoCSS) + + infoForm+='
Any blocks or suspensions made by moderators will be shown here.