From 01ca98648383b9d2716ffff80427f17a6a82e92c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 26 Nov 2022 11:19:30 +0000 Subject: [PATCH] Maximum preview posts on edit profile screen --- daemon.py | 3 ++- translations/ar.json | 3 ++- translations/bn.json | 3 ++- translations/ca.json | 3 ++- translations/cy.json | 3 ++- translations/de.json | 3 ++- translations/el.json | 3 ++- translations/en.json | 3 ++- translations/es.json | 3 ++- translations/fa.json | 3 ++- translations/fr.json | 3 ++- translations/ga.json | 3 ++- translations/hi.json | 3 ++- translations/it.json | 3 ++- translations/ja.json | 3 ++- translations/ko.json | 3 ++- translations/ku.json | 3 ++- translations/nl.json | 3 ++- translations/oc.json | 3 ++- translations/pl.json | 3 ++- translations/pt.json | 3 ++- translations/ru.json | 3 ++- translations/sw.json | 3 ++- translations/tr.json | 3 ++- translations/uk.json | 3 ++- translations/yi.json | 3 ++- translations/zh.json | 3 ++- webapp_profile.py | 15 ++++++++++++--- 28 files changed, 66 insertions(+), 30 deletions(-) diff --git a/daemon.py b/daemon.py index af91253c1..5b0b4622a 100644 --- a/daemon.py +++ b/daemon.py @@ -15463,7 +15463,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.system_language, - self.server.min_images_for_accounts) + self.server.min_images_for_accounts, + self.server.max_recent_posts) if msg: msg = msg.encode('utf-8') msglen = len(msg) diff --git a/translations/ar.json b/translations/ar.json index 1f50b68ad..0d0bff38d 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -600,5 +600,6 @@ "Allow announces": "تعلن السماح", "Send": "إرسال", "Minimize all images": "تصغير كل الصور", - "Edit post": "تعديل المنشور" + "Edit post": "تعديل المنشور", + "Preview posts on profile screen": "معاينة المشاركات على شاشة الملف الشخصي" } diff --git a/translations/bn.json b/translations/bn.json index 4b70f4f33..609bbf823 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -600,5 +600,6 @@ "Allow announces": "ঘোষণার অনুমতি দিন", "Send": "পাঠান", "Minimize all images": "সমস্ত ছবি ছোট করুন", - "Edit post": "পোস্ট সম্পাদনা করুন" + "Edit post": "পোস্ট সম্পাদনা করুন", + "Preview posts on profile screen": "প্রোফাইল স্ক্রিনে পোস্টের পূর্বরূপ দেখুন" } diff --git a/translations/ca.json b/translations/ca.json index 97b69e975..51d4620b2 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -600,5 +600,6 @@ "Allow announces": "Permet anuncis", "Send": "Enviar", "Minimize all images": "Minimitzar totes les imatges", - "Edit post": "Edita la publicació" + "Edit post": "Edita la publicació", + "Preview posts on profile screen": "Previsualitza les publicacions a la pantalla del perfil" } diff --git a/translations/cy.json b/translations/cy.json index f88dbb2e6..42cf7e740 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -600,5 +600,6 @@ "Allow announces": "Caniatáu cyhoeddiadau", "Send": "Anfon", "Minimize all images": "Lleihau pob delwedd", - "Edit post": "Golygu post" + "Edit post": "Golygu post", + "Preview posts on profile screen": "Rhagolwg postiadau ar sgrin proffil" } diff --git a/translations/de.json b/translations/de.json index 683504a2a..e08e893ac 100644 --- a/translations/de.json +++ b/translations/de.json @@ -600,5 +600,6 @@ "Allow announces": "Zulassen kündigt an", "Send": "Senden", "Minimize all images": "Alle Bilder minimieren", - "Edit post": "Beitrag bearbeiten" + "Edit post": "Beitrag bearbeiten", + "Preview posts on profile screen": "Vorschau von Beiträgen auf dem Profilbildschirm" } diff --git a/translations/el.json b/translations/el.json index e0ddf788d..081bd5784 100644 --- a/translations/el.json +++ b/translations/el.json @@ -600,5 +600,6 @@ "Allow announces": "Allow ανακοινώνει", "Send": "Στείλετε", "Minimize all images": "Ελαχιστοποίηση όλων των εικόνων", - "Edit post": "Επεξεργασία ανάρτησης" + "Edit post": "Επεξεργασία ανάρτησης", + "Preview posts on profile screen": "Προεπισκόπηση αναρτήσεων στην οθόνη προφίλ" } diff --git a/translations/en.json b/translations/en.json index d274d9768..5161d3eeb 100644 --- a/translations/en.json +++ b/translations/en.json @@ -600,5 +600,6 @@ "Allow announces": "Allow announces", "Send": "Send", "Minimize all images": "Minimize all images", - "Edit post": "Edit post" + "Edit post": "Edit post", + "Preview posts on profile screen": "Preview posts on profile screen" } diff --git a/translations/es.json b/translations/es.json index 07130a028..1031e2d86 100644 --- a/translations/es.json +++ b/translations/es.json @@ -600,5 +600,6 @@ "Allow announces": "Permitir anuncios", "Send": "Enviar", "Minimize all images": "Minimizar todas las imágenes", - "Edit post": "Editar post" + "Edit post": "Editar post", + "Preview posts on profile screen": "Vista previa de publicaciones en la pantalla de perfil" } diff --git a/translations/fa.json b/translations/fa.json index 31105a0c2..de35e6f84 100644 --- a/translations/fa.json +++ b/translations/fa.json @@ -600,5 +600,6 @@ "Allow announces": "اجازه اعلام می کند", "Send": "ارسال", "Minimize all images": "تمام تصاویر را به حداقل برسانید", - "Edit post": "ویرایش پست" + "Edit post": "ویرایش پست", + "Preview posts on profile screen": "پیش نمایش پست ها در صفحه نمایه" } diff --git a/translations/fr.json b/translations/fr.json index 9a2d62427..4777480d5 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -600,5 +600,6 @@ "Allow announces": "Autoriser les annonces", "Send": "Envoyer", "Minimize all images": "Réduire toutes les images", - "Edit post": "Modifier le message" + "Edit post": "Modifier le message", + "Preview posts on profile screen": "Prévisualiser les messages sur l'écran de profil" } diff --git a/translations/ga.json b/translations/ga.json index d90e1f9ea..86caa7e1a 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -600,5 +600,6 @@ "Allow announces": "Ceadaigh fógraí", "Send": "Seol", "Minimize all images": "Íoslaghdaigh gach íomhá", - "Edit post": "Cuir postáil in eagar" + "Edit post": "Cuir postáil in eagar", + "Preview posts on profile screen": "Réamhamhairc postálacha ar an scáileán próifíle" } diff --git a/translations/hi.json b/translations/hi.json index 4e6af33f5..603a02da1 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -600,5 +600,6 @@ "Allow announces": "घोषणा की अनुमति दें", "Send": "भेजना", "Minimize all images": "सभी छवियों को छोटा करें", - "Edit post": "संपादित पोस्ट" + "Edit post": "संपादित पोस्ट", + "Preview posts on profile screen": "प्रोफ़ाइल स्क्रीन पर पोस्ट का पूर्वावलोकन करें" } diff --git a/translations/it.json b/translations/it.json index bc4a48483..0d1cc770c 100644 --- a/translations/it.json +++ b/translations/it.json @@ -600,5 +600,6 @@ "Allow announces": "Consenti annunci", "Send": "Inviare", "Minimize all images": "Riduci a icona tutte le immagini", - "Edit post": "Modifica post" + "Edit post": "Modifica post", + "Preview posts on profile screen": "Visualizza l'anteprima dei post nella schermata del profilo" } diff --git a/translations/ja.json b/translations/ja.json index d0ef205fb..296f5d207 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -600,5 +600,6 @@ "Allow announces": "アナウンスを許可", "Send": "送信", "Minimize all images": "すべての画像を最小化", - "Edit post": "投稿を編集" + "Edit post": "投稿を編集", + "Preview posts on profile screen": "プロフィール画面で投稿をプレビュー" } diff --git a/translations/ko.json b/translations/ko.json index 8396fe024..315018b2e 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -600,5 +600,6 @@ "Allow announces": "리포스트 허용", "Send": "보내기", "Minimize all images": "모든 이미지 최소화", - "Edit post": "게시물 수정" + "Edit post": "게시물 수정", + "Preview posts on profile screen": "프로필 화면에서 게시물 미리보기" } diff --git a/translations/ku.json b/translations/ku.json index edd5840e9..1c084849d 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -600,5 +600,6 @@ "Allow announces": "Destûr dide ragihandin", "Send": "Şandin", "Minimize all images": "Hemî wêneyan kêm bikin", - "Edit post": "Biguherîne post" + "Edit post": "Biguherîne post", + "Preview posts on profile screen": "Mesajên li ser ekrana profîlê pêşdîtin" } diff --git a/translations/nl.json b/translations/nl.json index e84f8b472..209ca3db5 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -600,5 +600,6 @@ "Allow announces": "Aankondigingen toestaan", "Send": "Versturen", "Minimize all images": "Alle afbeeldingen minimaliseren", - "Edit post": "Bericht bewerken" + "Edit post": "Bericht bewerken", + "Preview posts on profile screen": "Bekijk berichten op het profielscherm" } diff --git a/translations/oc.json b/translations/oc.json index dfccb1eaf..1c1df0cee 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -596,5 +596,6 @@ "Allow announces": "Allow announces", "Send": "Send", "Minimize all images": "Minimize all images", - "Edit post": "Edit post" + "Edit post": "Edit post", + "Preview posts on profile screen": "Preview posts on profile screen" } diff --git a/translations/pl.json b/translations/pl.json index 82d3be6e7..003e756dc 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -600,5 +600,6 @@ "Allow announces": "Zezwól na ogłoszenia", "Send": "Wysłać", "Minimize all images": "Zminimalizuj wszystkie obrazy", - "Edit post": "Edytuj post" + "Edit post": "Edytuj post", + "Preview posts on profile screen": "Podgląd postów na ekranie profilu" } diff --git a/translations/pt.json b/translations/pt.json index 4d8788a15..475036cef 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -600,5 +600,6 @@ "Allow announces": "Permitir anúncios", "Send": "Mandar", "Minimize all images": "Minimize todas as imagens", - "Edit post": "Editar post" + "Edit post": "Editar post", + "Preview posts on profile screen": "Visualizar postagens na tela do perfil" } diff --git a/translations/ru.json b/translations/ru.json index 7ecc3357d..bc1a2acd6 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -600,5 +600,6 @@ "Allow announces": "Разрешить объявления", "Send": "Отправлять", "Minimize all images": "Свернуть все изображения", - "Edit post": "Редактировать сообщение" + "Edit post": "Редактировать сообщение", + "Preview posts on profile screen": "Предварительный просмотр сообщений на экране профиля" } diff --git a/translations/sw.json b/translations/sw.json index 56edf757d..48fd89928 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -600,5 +600,6 @@ "Allow announces": "Ruhusu matangazo", "Send": "Tuma", "Minimize all images": "Punguza picha zote", - "Edit post": "Badilisha chapisho" + "Edit post": "Badilisha chapisho", + "Preview posts on profile screen": "Hakiki machapisho kwenye skrini ya wasifu" } diff --git a/translations/tr.json b/translations/tr.json index 302a41e55..71d361767 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -600,5 +600,6 @@ "Allow announces": "Duyurulara izin ver", "Send": "Göndermek", "Minimize all images": "Tüm görüntüleri simge durumuna küçült", - "Edit post": "Gönderiyi düzenle" + "Edit post": "Gönderiyi düzenle", + "Preview posts on profile screen": "Gönderileri profil ekranında önizleyin" } diff --git a/translations/uk.json b/translations/uk.json index 40af127e9..a0ad0a3f1 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -600,5 +600,6 @@ "Allow announces": "Дозволити оголошення", "Send": "Надіслати", "Minimize all images": "Згорнути всі зображення", - "Edit post": "Редагувати пост" + "Edit post": "Редагувати пост", + "Preview posts on profile screen": "Попередній перегляд дописів на екрані профілю" } diff --git a/translations/yi.json b/translations/yi.json index 6d10f9509..c82a98b21 100644 --- a/translations/yi.json +++ b/translations/yi.json @@ -600,5 +600,6 @@ "Allow announces": "לאָזן אַנאַונסיז", "Send": "שיקן", "Minimize all images": "מינאַמייז אַלע בילדער", - "Edit post": "רעדאַגירן פּאָסטן" + "Edit post": "רעדאַגירן פּאָסטן", + "Preview posts on profile screen": "פאָרויסיקע ווייַזונג אַרטיקלען אויף פּראָפיל פאַרשטעלן" } diff --git a/translations/zh.json b/translations/zh.json index 02cab75a4..1a5004dd9 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -600,5 +600,6 @@ "Allow announces": "לאָזן אַנאַונסיז", "Send": "发送", "Minimize all images": "最小化所有图像", - "Edit post": "编辑帖子" + "Edit post": "编辑帖子", + "Preview posts on profile screen": "在个人资料屏幕上预览帖子" } diff --git a/webapp_profile.py b/webapp_profile.py index 074ddc5f7..3b5f4ade0 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -2249,7 +2249,8 @@ def _html_edit_profile_main(base_dir: str, display_nickname: str, bio_str: str, moved_to: str, donate_url: str, website_url: str, gemini_link: str, blog_address: str, actor_json: {}, translate: {}, - nickname: str, domain: str) -> str: + nickname: str, domain: str, + max_recent_posts: int) -> str: """main info on edit profile screen """ image_formats = get_image_formats() @@ -2333,6 +2334,13 @@ def _html_edit_profile_main(base_dir: str, display_nickname: str, bio_str: str, edit_check_box(translate['Keep DMs during post expiry'], 'expiryKeepDMs', keep_dms) + max_profile_posts = \ + _get_max_profile_posts(base_dir, nickname, domain, max_recent_posts) + edit_profile_form += \ + edit_number_field(translate['Preview posts on profile screen'], + 'maxRecentProfilePosts', max_profile_posts, + 1, 20, max_recent_posts) + edit_profile_form += ' \n' return edit_profile_form @@ -2387,7 +2395,8 @@ def html_edit_profile(server, translate: {}, default_reply_interval_hrs: int, cw_lists: {}, lists_enabled: str, system_language: str, - min_images_for_accounts: []) -> str: + min_images_for_accounts: [], + max_recent_posts: int) -> str: """Shows the edit profile screen """ path = path.replace('/inbox', '').replace('/outbox', '') @@ -2571,7 +2580,7 @@ def html_edit_profile(server, translate: {}, moved_to, donate_url, website_url, gemini_link, blog_address, actor_json, translate, - nickname, domain) + nickname, domain, max_recent_posts) # Option checkboxes edit_profile_form += \