mirror of https://gitlab.com/bashrc2/epicyon
Updating enabled cw lists
parent
2ad58b798e
commit
88c4b14ca3
|
@ -5696,9 +5696,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save blocked user agents
|
if isModerator(self.server.baseDir, nickname):
|
||||||
# This is admin lebel and global to the instance
|
|
||||||
if path.startswith('/users/' + adminNickname + '/'):
|
|
||||||
# set selected content warning lists
|
# set selected content warning lists
|
||||||
newListsEnabled = ''
|
newListsEnabled = ''
|
||||||
for name, item in self.server.CWlists.items():
|
for name, item in self.server.CWlists.items():
|
||||||
|
@ -5715,6 +5713,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
"listsEnabled",
|
"listsEnabled",
|
||||||
newListsEnabled)
|
newListsEnabled)
|
||||||
|
|
||||||
|
# save blocked user agents
|
||||||
userAgentsBlocked = []
|
userAgentsBlocked = []
|
||||||
if fields.get('userAgentsBlockedStr'):
|
if fields.get('userAgentsBlockedStr'):
|
||||||
userAgentsBlockedStr = \
|
userAgentsBlockedStr = \
|
||||||
|
|
|
@ -34,6 +34,7 @@ from person import personBoxJson
|
||||||
from person import getActorJson
|
from person import getActorJson
|
||||||
from person import getPersonAvatarUrl
|
from person import getPersonAvatarUrl
|
||||||
from webfinger import webfingerHandle
|
from webfinger import webfingerHandle
|
||||||
|
from posts import isModerator
|
||||||
from posts import parseUserFeed
|
from posts import parseUserFeed
|
||||||
from posts import getPersonBox
|
from posts import getPersonBox
|
||||||
from posts import isCreateInsideAnnounce
|
from posts import isCreateInsideAnnounce
|
||||||
|
@ -1667,31 +1668,32 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
'style="height:200px" spellcheck="false">' + \
|
'style="height:200px" spellcheck="false">' + \
|
||||||
allowedInstancesStr + '</textarea>\n'
|
allowedInstancesStr + '</textarea>\n'
|
||||||
|
|
||||||
userAgentsBlockedStr = ''
|
if isModerator(baseDir, nickname):
|
||||||
for ua in userAgentsBlocked:
|
userAgentsBlockedStr = ''
|
||||||
if userAgentsBlockedStr:
|
for ua in userAgentsBlocked:
|
||||||
userAgentsBlockedStr += '\n'
|
if userAgentsBlockedStr:
|
||||||
userAgentsBlockedStr += ua
|
userAgentsBlockedStr += '\n'
|
||||||
editProfileForm += \
|
userAgentsBlockedStr += ua
|
||||||
editTextArea(translate['Blocked User Agents'],
|
|
||||||
'userAgentsBlockedStr', userAgentsBlockedStr,
|
|
||||||
200, '', False)
|
|
||||||
|
|
||||||
CWlistsStr = ''
|
|
||||||
for name, item in CWlists.items():
|
|
||||||
variableName = getCWlistVariable(name)
|
|
||||||
listIsEnabled = False
|
|
||||||
if listsEnabled:
|
|
||||||
if name in listsEnabled:
|
|
||||||
listIsEnabled = True
|
|
||||||
if translate.get(name):
|
|
||||||
name = translate[name]
|
|
||||||
CWlistsStr += editCheckBox(name, variableName, listIsEnabled)
|
|
||||||
if CWlistsStr:
|
|
||||||
idx = 'Add content warnings for the following sites'
|
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
'<label class="labels">' + translate[idx] + ':</label>\n' + \
|
editTextArea(translate['Blocked User Agents'],
|
||||||
'<br>' + CWlistsStr
|
'userAgentsBlockedStr', userAgentsBlockedStr,
|
||||||
|
200, '', False)
|
||||||
|
|
||||||
|
CWlistsStr = ''
|
||||||
|
for name, item in CWlists.items():
|
||||||
|
variableName = getCWlistVariable(name)
|
||||||
|
listIsEnabled = False
|
||||||
|
if listsEnabled:
|
||||||
|
if name in listsEnabled:
|
||||||
|
listIsEnabled = True
|
||||||
|
if translate.get(name):
|
||||||
|
name = translate[name]
|
||||||
|
CWlistsStr += editCheckBox(name, variableName, listIsEnabled)
|
||||||
|
if CWlistsStr:
|
||||||
|
idx = 'Add content warnings for the following sites'
|
||||||
|
editProfileForm += \
|
||||||
|
'<label class="labels">' + translate[idx] + ':</label>\n' + \
|
||||||
|
'<br>' + CWlistsStr
|
||||||
|
|
||||||
editProfileForm += endEditSection()
|
editProfileForm += endEditSection()
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
Loading…
Reference in New Issue