Show selectable lists

main
Bob Mottram 2021-10-21 17:58:01 +01:00
parent 6a79a6d3c7
commit 48c298f5f8
19 changed files with 58 additions and 21 deletions

View File

@ -11774,7 +11774,9 @@ class PubServer(BaseHTTPRequestHandler):
city, city,
self.server.userAgentsBlocked, self.server.userAgentsBlocked,
accessKeys, accessKeys,
defaultReplyIntervalHours).encode('utf-8') defaultReplyIntervalHours,
self.server.CWlists,
self.server.listsEnabled).encode('utf-8')
if msg: if msg:
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,

View File

@ -488,5 +488,6 @@
"Members": "أعضاء", "Members": "أعضاء",
"Join": "انضم", "Join": "انضم",
"Leave": "يترك", "Leave": "يترك",
"System Monitor": "مراقب النظام" "System Monitor": "مراقب النظام",
"Add content warnings for the following sites": "أضف تحذيرات المحتوى للمواقع التالية"
} }

View File

@ -488,5 +488,6 @@
"Members": "Membres", "Members": "Membres",
"Join": "Uneix-te", "Join": "Uneix-te",
"Leave": "Marxa", "Leave": "Marxa",
"System Monitor": "Monitor del sistema" "System Monitor": "Monitor del sistema",
"Add content warnings for the following sites": "Afegiu advertiments de contingut per als llocs següents"
} }

View File

@ -488,5 +488,6 @@
"Members": "Aelodau", "Members": "Aelodau",
"Join": "Ymunwch", "Join": "Ymunwch",
"Leave": "Gadewch", "Leave": "Gadewch",
"System Monitor": "Monitor System" "System Monitor": "Monitor System",
"Add content warnings for the following sites": "Ychwanegwch rybuddion cynnwys ar gyfer y gwefannau canlynol"
} }

View File

@ -488,5 +488,6 @@
"Members": "Mitglieder", "Members": "Mitglieder",
"Join": "Verbinden", "Join": "Verbinden",
"Leave": "Verlassen", "Leave": "Verlassen",
"System Monitor": "Systemmonitor" "System Monitor": "Systemmonitor",
"Add content warnings for the following sites": "Inhaltswarnungen für die folgenden Websites hinzufügen"
} }

View File

@ -488,5 +488,6 @@
"Members": "Members", "Members": "Members",
"Join": "Join", "Join": "Join",
"Leave": "Leave", "Leave": "Leave",
"System Monitor": "System Monitor" "System Monitor": "System Monitor",
"Add content warnings for the following sites": "Add content warnings for the following sites"
} }

View File

@ -488,5 +488,6 @@
"Members": "Miembros", "Members": "Miembros",
"Join": "Entrar", "Join": "Entrar",
"Leave": "Dejar", "Leave": "Dejar",
"System Monitor": "Monitor del sistema" "System Monitor": "Monitor del sistema",
"Add content warnings for the following sites": "Agregue advertencias de contenido para los siguientes sitios"
} }

View File

@ -488,5 +488,6 @@
"Members": "Membres", "Members": "Membres",
"Join": "Rejoindre", "Join": "Rejoindre",
"Leave": "Laisser", "Leave": "Laisser",
"System Monitor": "Moniteur système" "System Monitor": "Moniteur système",
"Add content warnings for the following sites": "Ajouter des avertissements de contenu pour les sites suivants"
} }

View File

@ -488,5 +488,6 @@
"Members": "Baill", "Members": "Baill",
"Join": "Bí páirteach", "Join": "Bí páirteach",
"Leave": "Fág", "Leave": "Fág",
"System Monitor": "Monatóir Córais" "System Monitor": "Monatóir Córais",
"Add content warnings for the following sites": "Cuir rabhaidh ábhair leis na suíomhanna seo a leanas"
} }

View File

@ -488,5 +488,6 @@
"Members": "सदस्यों", "Members": "सदस्यों",
"Join": "शामिल हों", "Join": "शामिल हों",
"Leave": "छोड़ना", "Leave": "छोड़ना",
"System Monitor": "सिस्टम मॉनिटर" "System Monitor": "सिस्टम मॉनिटर",
"Add content warnings for the following sites": "निम्नलिखित साइटों के लिए सामग्री चेतावनियाँ जोड़ें"
} }

View File

@ -488,5 +488,6 @@
"Members": "Membri", "Members": "Membri",
"Join": "Aderire", "Join": "Aderire",
"Leave": "Lasciare", "Leave": "Lasciare",
"System Monitor": "Monitor di sistema" "System Monitor": "Monitor di sistema",
"Add content warnings for the following sites": "Aggiungi avvisi sui contenuti per i seguenti siti"
} }

View File

@ -488,5 +488,6 @@
"Members": "メンバー", "Members": "メンバー",
"Join": "加入", "Join": "加入",
"Leave": "離れる", "Leave": "離れる",
"System Monitor": "システムモニター" "System Monitor": "システムモニター",
"Add content warnings for the following sites": "次のサイトのコンテンツ警告を追加します"
} }

View File

@ -488,5 +488,6 @@
"Members": "Endam", "Members": "Endam",
"Join": "Bihevgirêdan", "Join": "Bihevgirêdan",
"Leave": "Terikandin", "Leave": "Terikandin",
"System Monitor": "System Monitor" "System Monitor": "System Monitor",
"Add content warnings for the following sites": "Ji bo malperên jêrîn hişyariyên naverokê zêde bikin"
} }

View File

@ -484,5 +484,6 @@
"Members": "Members", "Members": "Members",
"Join": "Join", "Join": "Join",
"Leave": "Leave", "Leave": "Leave",
"System Monitor": "System Monitor" "System Monitor": "System Monitor",
"Add content warnings for the following sites": "Add content warnings for the following sites"
} }

View File

@ -488,5 +488,6 @@
"Members": "Membros", "Members": "Membros",
"Join": "Juntar", "Join": "Juntar",
"Leave": "Sair", "Leave": "Sair",
"System Monitor": "Monitor de Sistema" "System Monitor": "Monitor de Sistema",
"Add content warnings for the following sites": "Adicione avisos de conteúdo para os seguintes sites"
} }

View File

@ -488,5 +488,6 @@
"Members": "Члены", "Members": "Члены",
"Join": "Присоединиться", "Join": "Присоединиться",
"Leave": "Оставлять", "Leave": "Оставлять",
"System Monitor": "Системный монитор" "System Monitor": "Системный монитор",
"Add content warnings for the following sites": "Добавить предупреждения о содержании для следующих сайтов"
} }

View File

@ -488,5 +488,6 @@
"Members": "Wanachama", "Members": "Wanachama",
"Join": "Jiunge", "Join": "Jiunge",
"Leave": "Ondoka", "Leave": "Ondoka",
"System Monitor": "Ufuatiliaji wa Mfumo" "System Monitor": "Ufuatiliaji wa Mfumo",
"Add content warnings for the following sites": "Ongeza maonyo ya yaliyomo kwa wavuti zifuatazo"
} }

View File

@ -488,5 +488,6 @@
"Members": "会员", "Members": "会员",
"Join": "加入", "Join": "加入",
"Leave": "离开", "Leave": "离开",
"System Monitor": "系统监视器" "System Monitor": "系统监视器",
"Add content warnings for the following sites": "为以下网站添加内容警告"
} }

View File

@ -1518,7 +1518,8 @@ def _htmlEditProfileSharedItems(baseDir: str, nickname: str, domain: str,
def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str, def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
userAgentsBlocked: str, translate: {}, userAgentsBlocked: str, translate: {},
replyIntervalHours: int) -> str: replyIntervalHours: int,
CWlists: {}, listsEnabled: str) -> str:
"""Filtering and blocking section of edit profile screen """Filtering and blocking section of edit profile screen
""" """
filterStr = '' filterStr = ''
@ -1674,6 +1675,21 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
'userAgentsBlockedStr', userAgentsBlockedStr, 'userAgentsBlockedStr', userAgentsBlockedStr,
200, '', False) 200, '', False)
idx = 'Add content warnings for the following sites'
editProfileForm += \
'<label class="labels">' + translate[idx] + ':</label>\n'
for listName, item in CWlists.items():
name = listName
variableName = 'list' + name.replace(' ', '').replace("'", '')
if listName in listsEnabled:
listIsEnabled = True
else:
listIsEnabled = False
if translate.get(name):
name = translate[name]
editProfileForm += editCheckBox(name, variableName, listIsEnabled)
editProfileForm += endEditSection() editProfileForm += endEditSection()
return editProfileForm return editProfileForm
@ -1956,7 +1972,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
textModeBanner: str, city: str, textModeBanner: str, city: str,
userAgentsBlocked: str, userAgentsBlocked: str,
accessKeys: {}, accessKeys: {},
defaultReplyIntervalHours: int) -> str: defaultReplyIntervalHours: int,
CWlists: {}, listsEnabled: str) -> str:
"""Shows the edit profile screen """Shows the edit profile screen
""" """
path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/inbox', '').replace('/outbox', '')
@ -2152,7 +2169,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
editProfileForm += \ editProfileForm += \
_htmlEditProfileFiltering(baseDir, nickname, domain, _htmlEditProfileFiltering(baseDir, nickname, domain,
userAgentsBlocked, translate, userAgentsBlocked, translate,
replyIntervalHours) replyIntervalHours,
CWlists, listsEnabled)
# git projects section # git projects section
editProfileForm += \ editProfileForm += \