From 0b47d6fd3df9f8e764d66b81327c43bc581cd068 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Jul 2020 20:11:05 +0100 Subject: [PATCH] Checkbox for receiving calendar events --- 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 | 17 +++++++++++++++++ 16 files changed, 47 insertions(+), 15 deletions(-) diff --git a/translations/ar.json b/translations/ar.json index ba2b00d3e..60bc5a4e4 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -248,5 +248,6 @@ "Bad Request": "اقتراح غير جيد", "Better luck next time": "حظ أوفر في المرة القادمة", "Unavailable": "غير متوفره", - "The server is busy. Please try again later": "الخادم مشغول. الرجاء معاودة المحاولة في وقت لاحق" + "The server is busy. Please try again later": "الخادم مشغول. الرجاء معاودة المحاولة في وقت لاحق", + "Receive calendar events from this account": "تلقي أحداث التقويم من هذا الحساب" } diff --git a/translations/ca.json b/translations/ca.json index e8388833d..844521d30 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -248,5 +248,6 @@ "Bad Request": "Sol·licitud incorrecta", "Better luck next time": "Que tingueu més sort la propera vegada", "Unavailable": "No disponible", - "The server is busy. Please try again later": "El servidor està ocupat. Siusplau, intenta-ho més tard" + "The server is busy. Please try again later": "El servidor està ocupat. Siusplau, intenta-ho més tard", + "Receive calendar events from this account": "Rep esdeveniments del calendari des d’aquest compte" } diff --git a/translations/cy.json b/translations/cy.json index b78d4f665..f7536e907 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -248,5 +248,6 @@ "Bad Request": "Cais drwg", "Better luck next time": "Gwell lwc y tro nesaf", "Unavailable": "Ddim ar gael", - "The server is busy. Please try again later": "Mae'r gweinydd yn brysur. Rho gynnig Arni eto'n hwyrach" + "The server is busy. Please try again later": "Mae'r gweinydd yn brysur. Rho gynnig Arni eto'n hwyrach", + "Receive calendar events from this account": "Derbyn digwyddiadau calendr o'r cyfrif hwn" } diff --git a/translations/de.json b/translations/de.json index 78dd165f6..f784ebbf4 100644 --- a/translations/de.json +++ b/translations/de.json @@ -248,5 +248,6 @@ "Bad Request": "Ungültige Anforderung", "Better luck next time": "Viel Glück beim nächsten Mal", "Unavailable": "Nicht verfügbar", - "The server is busy. Please try again later": "Der Server ist beschäftigt. Bitte versuchen Sie es später noch einmal" + "The server is busy. Please try again later": "Der Server ist beschäftigt. Bitte versuchen Sie es später noch einmal", + "Receive calendar events from this account": "Erhalten Sie Kalenderereignisse von diesem Konto" } diff --git a/translations/en.json b/translations/en.json index 201a33cda..e11d6ade8 100644 --- a/translations/en.json +++ b/translations/en.json @@ -248,5 +248,6 @@ "Bad Request": "Bad Request", "Better luck next time": "Better luck next time", "Unavailable": "Unavailable", - "The server is busy. Please try again later": "The server is busy. Please try again later" + "The server is busy. Please try again later": "The server is busy. Please try again later", + "Receive calendar events from this account": "Receive calendar events from this account" } diff --git a/translations/es.json b/translations/es.json index 4eadba308..dc5801012 100644 --- a/translations/es.json +++ b/translations/es.json @@ -248,5 +248,6 @@ "Bad Request": "Solicitud incorrecta", "Better luck next time": "Mejor suerte la próxima vez", "Unavailable": "Indisponible", - "The server is busy. Please try again later": "El servidor esta ocupado. Por favor, inténtelo de nuevo más tarde" + "The server is busy. Please try again later": "El servidor esta ocupado. Por favor, inténtelo de nuevo más tarde", + "Receive calendar events from this account": "Recibe eventos de calendario de esta cuenta" } diff --git a/translations/fr.json b/translations/fr.json index 0fdec7b7a..a9cbcb8a2 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -248,5 +248,6 @@ "Bad Request": "Mauvaise Demande", "Better luck next time": "Plus de chance la prochaine fois", "Unavailable": "Indisponible", - "The server is busy. Please try again later": "Le serveur est occupé. Veuillez réessayer plus tard" + "The server is busy. Please try again later": "Le serveur est occupé. Veuillez réessayer plus tard", + "Receive calendar events from this account": "Recevoir des événements d'agenda de ce compte" } diff --git a/translations/ga.json b/translations/ga.json index 3dcc0badf..603202d8c 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -248,5 +248,6 @@ "Bad Request": "Droch-Iarraidh", "Better luck next time": "Ádh níos fearr an chéad uair eile", "Unavailable": "Níl sé ar fáil", - "The server is busy. Please try again later": "Tá an freastalaí gnóthach. Bain triail eile as níos déanaí" + "The server is busy. Please try again later": "Tá an freastalaí gnóthach. Bain triail eile as níos déanaí", + "Receive calendar events from this account": "Faigh imeachtaí féilire ón gcuntas seo" } diff --git a/translations/hi.json b/translations/hi.json index c671f16c4..9f02c144b 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -248,5 +248,6 @@ "Bad Request": "खराब अनुरोध", "Better luck next time": "अगली बार किस्मत तुम्हारा साथ देगी", "Unavailable": "अनुपलब्ध", - "The server is busy. Please try again later": "सर्वर व्यस्त है। बाद में पुन: प्रयास करें" + "The server is busy. Please try again later": "सर्वर व्यस्त है। बाद में पुन: प्रयास करें", + "Receive calendar events from this account": "इस खाते से कैलेंडर ईवेंट प्राप्त करें" } diff --git a/translations/it.json b/translations/it.json index 5306ebc28..3fe48c28c 100644 --- a/translations/it.json +++ b/translations/it.json @@ -248,5 +248,6 @@ "Bad Request": "Brutta richiesta", "Better luck next time": "La prossima volta sarai più fortunato", "Unavailable": "non disponibile", - "The server is busy. Please try again later": "Il server è occupato. Per favore riprova più tardi" + "The server is busy. Please try again later": "Il server è occupato. Per favore riprova più tardi", + "Receive calendar events from this account": "Ricevi eventi di calendario da questo account" } diff --git a/translations/ja.json b/translations/ja.json index 63a4cb1de..f3e6d6bb6 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -248,5 +248,6 @@ "Bad Request": "要求の形式が正しくありません", "Better luck next time": "次回は幸運を", "Unavailable": "利用できません", - "The server is busy. Please try again later": "サーバーはビジーです。 後でもう一度やり直してください" + "The server is busy. Please try again later": "サーバーはビジーです。 後でもう一度やり直してください", + "Receive calendar events from this account": "このアカウントからカレンダーイベントを受信します" } diff --git a/translations/oc.json b/translations/oc.json index dc4a9a9b9..ba8b1c550 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -244,5 +244,6 @@ "Bad Request": "Bad Request", "Better luck next time": "Better luck next time", "Unavailable": "Unavailable", - "The server is busy. Please try again later": "The server is busy. Please try again later" + "The server is busy. Please try again later": "The server is busy. Please try again later", + "Receive calendar events from this account": "Receive calendar events from this account" } diff --git a/translations/pt.json b/translations/pt.json index af1ae1cfc..2f9c5b5e8 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -248,5 +248,6 @@ "Bad Request": "Pedido ruim", "Better luck next time": "Mais sorte da próxima vez", "Unavailable": "Indisponível", - "The server is busy. Please try again later": "O servidor está ocupado. Por favor, tente novamente mais tarde" + "The server is busy. Please try again later": "O servidor está ocupado. Por favor, tente novamente mais tarde", + "Receive calendar events from this account": "Receba eventos da agenda desta conta" } diff --git a/translations/ru.json b/translations/ru.json index fdd70b8db..290f301fa 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -248,5 +248,6 @@ "Bad Request": "Неверный запрос", "Better luck next time": "Повезет в следующий раз", "Unavailable": "Недоступен", - "The server is busy. Please try again later": "Сервер занят. Пожалуйста, попробуйте позже" + "The server is busy. Please try again later": "Сервер занят. Пожалуйста, попробуйте позже", + "Receive calendar events from this account": "Получать события календаря от этого аккаунта" } diff --git a/translations/zh.json b/translations/zh.json index 001e44e4c..bd0ba1eb5 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -247,5 +247,6 @@ "Bad Request": "错误的请求", "Better luck next time": "下次好运", "Unavailable": "不可用", - "The server is busy. Please try again later": "服务器忙。 请稍后再试" + "The server is busy. Please try again later": "服务器忙。 请稍后再试", + "Receive calendar events from this account": "从该帐户接收日历事件" } diff --git a/webinterface.py b/webinterface.py index 8fc5f48fd..d6c3ec54a 100644 --- a/webinterface.py +++ b/webinterface.py @@ -74,6 +74,7 @@ from happening import getTodaysEvents from git import isGitPatch from theme import getThemesList from petnames import getPetName +from calendar import receivingCalendarEvents def getContentWarningButton(postID: str, translate: {}, @@ -5450,6 +5451,22 @@ def htmlPersonOptions(translate: {}, baseDir: str, optionsStr += \ ' ' + if isFollowingActor(baseDir, nickname, domain, optionsActor): + actorNickname = getNicknameFromActor(optionsActor) + actorDomain, actorPort = getDomainFromActor(optionsActor) + if receivingCalendarEvents(baseDir, nickname, domain, + actorNickname, actorDomain): + optionsStr += \ + '
' + \ + translate['Receive calendar events from this account'] + else: + optionsStr += \ + '
' + \ + translate['Receive calendar events from this account'] + optionsStr += ' ' optionsStr += '' optionsStr += ''