From b619533866cdfdc800fbe7efd43a5e80ed296a0b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 21 Aug 2020 20:51:35 +0100 Subject: [PATCH] Option to disable replies on posts --- daemon.py | 4 +++- translations/ar.json | 3 ++- translations/ca.json | 3 ++- translations/cy.json | 3 ++- translations/de.json | 3 ++- translations/en.json | 3 ++- translations/es.json | 3 ++- translations/fr.json | 3 ++- translations/ga.json | 3 ++- translations/hi.json | 3 ++- translations/it.json | 3 ++- translations/ja.json | 3 ++- translations/oc.json | 3 ++- translations/pt.json | 3 ++- translations/ru.json | 3 ++- translations/zh.json | 3 ++- webinterface.py | 5 +++++ 17 files changed, 38 insertions(+), 16 deletions(-) diff --git a/daemon.py b/daemon.py index 965c54a9..c230a830 100644 --- a/daemon.py +++ b/daemon.py @@ -5490,11 +5490,13 @@ class PubServer(BaseHTTPRequestHandler): fields['subject'] = None if not fields.get('replyTo'): fields['replyTo'] = None + if not fields.get('schedulePost'): fields['schedulePost'] = False else: fields['schedulePost'] = True print('DEBUG: shedulePost ' + str(fields['schedulePost'])) + if not fields.get('eventDate'): fields['eventDate'] = None if not fields.get('eventTime'): @@ -5520,7 +5522,7 @@ class PubServer(BaseHTTPRequestHandler): if fields.get('mentions'): mentionsStr = fields['mentions'].strip() + ' ' commentsEnabled = True - if fields.get('commentsEnabled'): + if 'commentsEnabled' in fields: commentsEnabled = fields['commentsEnabled'] if postType == 'newpost': messageJson = \ diff --git a/translations/ar.json b/translations/ar.json index b13483b4..dfc191fa 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -255,5 +255,6 @@ "Liked by": "نال إعجاب", "Solidaric": "تضامن", "YouTube Replacement Domain": "استبدال نطاق يوتيوب", - "Notes": "ملاحظات" + "Notes": "ملاحظات", + "Allow replies.": "السماح بالردود." } diff --git a/translations/ca.json b/translations/ca.json index 774fd067..97b26f58 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -255,5 +255,6 @@ "Liked by": "M'agrada", "Solidaric": "Solidaritat", "YouTube Replacement Domain": "Domini de substitució de YouTube", - "Notes": "Notes" + "Notes": "Notes", + "Allow replies.": "Permetre respostes." } diff --git a/translations/cy.json b/translations/cy.json index 28f8cdc3..6b5448c6 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -255,5 +255,6 @@ "Liked by": "Hoffi", "Solidaric": "Undod", "YouTube Replacement Domain": "Parth Amnewid YouTube", - "Notes": "Nodiadau" + "Notes": "Nodiadau", + "Allow replies.": "Caniatáu atebion." } diff --git a/translations/de.json b/translations/de.json index 86f69595..f755d691 100644 --- a/translations/de.json +++ b/translations/de.json @@ -255,5 +255,6 @@ "Liked by": "Gefallen von", "Solidaric": "Solidarität", "YouTube Replacement Domain": "YouTube-Ersatzdomain", - "Notes": "Anmerkungen" + "Notes": "Anmerkungen", + "Allow replies.": "Antworten zulassen." } diff --git a/translations/en.json b/translations/en.json index 4a559bb4..80377883 100644 --- a/translations/en.json +++ b/translations/en.json @@ -255,5 +255,6 @@ "Liked by": "Liked by", "Solidaric": "Solidaric", "YouTube Replacement Domain": "YouTube Replacement Domain", - "Notes": "Notes" + "Notes": "Notes", + "Allow replies.": "Allow replies." } diff --git a/translations/es.json b/translations/es.json index e19e01a6..849df9d5 100644 --- a/translations/es.json +++ b/translations/es.json @@ -255,5 +255,6 @@ "Liked by": "Apreciado por", "Solidaric": "Solidaridad", "YouTube Replacement Domain": "Dominio de reemplazo de YouTube", - "Notes": "Notas" + "Notes": "Notas", + "Allow replies.": "Permitir respuestas." } diff --git a/translations/fr.json b/translations/fr.json index 17dafb27..c55fc956 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -255,5 +255,6 @@ "Liked by": "Aimé par", "Solidaric": "Solidarité", "YouTube Replacement Domain": "Domaine de remplacement YouTube", - "Notes": "Remarques" + "Notes": "Remarques", + "Allow replies.": "Autoriser les réponses." } diff --git a/translations/ga.json b/translations/ga.json index b012a809..4c922cd2 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -255,5 +255,6 @@ "Liked by": "Thaitin", "Solidaric": "Dlúthpháirtíocht", "YouTube Replacement Domain": "Fearann Athsholáthair YouTube", - "Notes": "Nótaí" + "Notes": "Nótaí", + "Allow replies.": "Ceadaigh freagraí." } diff --git a/translations/hi.json b/translations/hi.json index a05b9e38..593ac348 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -255,5 +255,6 @@ "Liked by": "द्वारा पसंद किया गया", "Solidaric": "एकजुटता", "YouTube Replacement Domain": "YouTube रिप्लेसमेंट डोमेन", - "Notes": "टिप्पणियाँ" + "Notes": "टिप्पणियाँ", + "Allow replies.": "जवाब दें।" } diff --git a/translations/it.json b/translations/it.json index 356112f6..e01fb2f1 100644 --- a/translations/it.json +++ b/translations/it.json @@ -255,5 +255,6 @@ "Liked by": "Mi è piaciuto", "Solidaric": "Solidarietà", "YouTube Replacement Domain": "Dominio sostitutivo di YouTube", - "Notes": "Appunti" + "Notes": "Appunti", + "Allow replies.": "Consenti risposte." } diff --git a/translations/ja.json b/translations/ja.json index 89351b41..36b76b47 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -255,5 +255,6 @@ "Liked by": "好き", "Solidaric": "連帯", "YouTube Replacement Domain": "YouTube交換ドメイン", - "Notes": "ノート" + "Notes": "ノート", + "Allow replies.": "返信を許可します。" } diff --git a/translations/oc.json b/translations/oc.json index 71eddf62..449e85c8 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -251,5 +251,6 @@ "Liked by": "Liked by", "Solidaric": "Solidaric", "YouTube Replacement Domain": "YouTube Replacement Domain", - "Notes": "Notes" + "Notes": "Notes", + "Allow replies.": "Allow replies." } diff --git a/translations/pt.json b/translations/pt.json index 79c2a7ce..72343c20 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -255,5 +255,6 @@ "Liked by": "Curtida por", "Solidaric": "Solidariedade", "YouTube Replacement Domain": "Domínio de substituição do YouTube", - "Notes": "Notas" + "Notes": "Notas", + "Allow replies.": "Permitir respostas." } diff --git a/translations/ru.json b/translations/ru.json index e9befe81..0e57ff62 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -255,5 +255,6 @@ "Liked by": "Понравилось", "Solidaric": "солидарность", "YouTube Replacement Domain": "Запасной домен YouTube", - "Notes": "Ноты" + "Notes": "Ноты", + "Allow replies.": "Разрешить ответы." } diff --git a/translations/zh.json b/translations/zh.json index 2afa7f0c..888a7ada 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -255,5 +255,6 @@ "Liked by": "喜欢的人", "Solidaric": "团结互助", "YouTube Replacement Domain": "YouTube替换域", - "Notes": "笔记" + "Notes": "笔记", + "Allow replies.": "允许回复。" } diff --git a/webinterface.py b/webinterface.py index 6d766c8f..9122e490 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2029,6 +2029,11 @@ def htmlNewPost(mediaInstance: bool, translate: {}, endpoint != 'newquestion': dateAndLocation = '
' + dateAndLocation += \ + '

\n' + if not inReplyTo: dateAndLocation += \ '