diff --git a/daemon.py b/daemon.py index 193ea3a8f..fa340b2af 100644 --- a/daemon.py +++ b/daemon.py @@ -2845,6 +2845,11 @@ class PubServer(BaseHTTPRequestHandler): showPublishedDateOnly = self.server.showPublishedDateOnly allowLocalNetworkAccess = \ self.server.allowLocalNetworkAccess + + accessKeys = self.server.accessKeys + if self.server.keyShortcuts.get(nickname): + accessKeys = self.server.keyShortcuts[nickname] + profileStr = \ htmlProfileAfterSearch(self.server.cssCache, self.server.recentPostsCache, @@ -2867,7 +2872,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.defaultTimeline, self.server.peertubeInstances, allowLocalNetworkAccess, - self.server.themeName) + self.server.themeName, + accessKeys) if profileStr: msg = profileStr.encode('utf-8') msglen = len(msg) @@ -5718,6 +5724,13 @@ class PubServer(BaseHTTPRequestHandler): optionsActor, optionsProfileUrl, self.server.personCache, 5) + accessKeys = self.server.accessKeys + if '/users/' in path: + nickname = path.split('/users/')[1] + if '/' in nickname: + nickname = nickname.split('/')[0] + if self.server.keyShortcuts.get(nickname): + accessKeys = self.server.keyShortcuts[nickname] msg = htmlPersonOptions(self.server.defaultTimeline, self.server.cssCache, self.server.translate, @@ -5740,7 +5753,8 @@ class PubServer(BaseHTTPRequestHandler): movedTo, alsoKnownAs, self.server.textModeBanner, self.server.newsInstance, - authorized).encode('utf-8') + authorized, + accessKeys).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, callingDomain) @@ -14658,6 +14672,14 @@ def runDaemon(brochMode: bool, # key shortcuts SHIFT + ALT + [key] httpd.accessKeys = { 'submitButton': 'y', + 'followButton': 'f', + 'blockButton': 'b', + 'infoButton': 'i', + 'snoozeButton': 's', + 'reportButton': 'r', + 'viewButton': 'v', + 'enterPetname': 'p', + 'enterNotes': 'n', 'menuTimeline': 't', 'menuEdit': 'e', 'menuProfile': 'p', @@ -14673,7 +14695,8 @@ def runDaemon(brochMode: bool, 'menuBlogs': 'b', 'menuNewswire': 'w', 'menuLinks': 'l', - 'menuModeration': 'm', + 'menuMedia': 'm', + 'menuModeration': 'o', 'menuFollowing': 'f', 'menuFollowers': 'g', 'menuRoles': 'o', diff --git a/translations/ar.json b/translations/ar.json index 5eb4c3dff..00bed874d 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -427,5 +427,14 @@ "menuSkills": "مهارات", "menuLogout": "تسجيل خروج", "menuKeys": "الاختصارات الرئيسية", - "submitButton": "زر الإرسال" + "submitButton": "زر الإرسال", + "menuMedia": "وسائط", + "followButton": "زر متابعة / متابعة", + "blockButton": "زر كتلة", + "infoButton": "زر المعلومات", + "snoozeButton": "زر الغفوة", + "reportButton": "زر تقرير", + "viewButton": "عرض زر", + "enterPetname": "أدخل PETNAME", + "enterNotes": "أدخل الملاحظات" } diff --git a/translations/ca.json b/translations/ca.json index 86658f70c..9c6f0ecdb 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -427,5 +427,14 @@ "menuSkills": "Habilitats", "menuLogout": "Tancar sessió", "menuKeys": "Dreceres clau", - "submitButton": "Envia el botó" + "submitButton": "Envia el botó", + "menuMedia": "Medis de comunicació", + "followButton": "Seguiu / no seguit", + "blockButton": "Botó de bloc", + "infoButton": "Botó d'informació", + "snoozeButton": "Botó de snooze", + "reportButton": "Botó d'informe", + "viewButton": "Botó Veure", + "enterPetname": "Introduïu PETNAME", + "enterNotes": "Introduïu notes" } diff --git a/translations/cy.json b/translations/cy.json index 40b88e4e9..3ffc9c8f9 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -427,5 +427,14 @@ "menuSkills": "Medrau", "menuLogout": "Allgofnodi", "menuKeys": "Llwybrau byr allweddol", - "submitButton": "Cyflwyno botwm" + "submitButton": "Cyflwyno botwm", + "menuMedia": "Chyfryngau", + "followButton": "Dilynwch / Peidiwch â Dilynwch y botwm", + "blockButton": "Botwm bloc", + "infoButton": "Botwm info", + "snoozeButton": "Botwm Snooze", + "reportButton": "Botwm adroddiadau", + "viewButton": "Gweld y botwm", + "enterPetname": "Rhowch enw PETName", + "enterNotes": "Rhowch nodiadau" } diff --git a/translations/de.json b/translations/de.json index 370a2a200..2473a4be4 100644 --- a/translations/de.json +++ b/translations/de.json @@ -427,5 +427,14 @@ "menuSkills": "Kompetenzen", "menuLogout": "Ausloggen", "menuKeys": "Schlüsselverknüpfungen", - "submitButton": "Button einreichen" + "submitButton": "Button einreichen", + "menuMedia": "Medien", + "followButton": "Folgen / folgen Sie nicht der Taste", + "blockButton": "Blockknopf", + "infoButton": "Info-Taste", + "snoozeButton": "Schlummertaste", + "reportButton": "Berichtsknopf", + "viewButton": "Schaltfläche anzeigen", + "enterPetname": "Petname eingeben", + "enterNotes": "Notizen eingeben" } diff --git a/translations/en.json b/translations/en.json index a08b8fe22..7dbe1d4e4 100644 --- a/translations/en.json +++ b/translations/en.json @@ -427,5 +427,14 @@ "menuSkills": "Skills", "menuLogout": "Logout", "menuKeys": "Key Shortcuts", - "submitButton": "Submit button" + "submitButton": "Submit button", + "menuMedia": "Media", + "followButton": "Follow/unfollow button", + "blockButton": "Block button", + "infoButton": "Info button", + "snoozeButton": "Snooze button", + "reportButton": "Report button", + "viewButton": "View button", + "enterPetname": "Enter petname", + "enterNotes": "Enter notes" } diff --git a/translations/es.json b/translations/es.json index f2a40a394..b54ee96fe 100644 --- a/translations/es.json +++ b/translations/es.json @@ -427,5 +427,14 @@ "menuSkills": "Habilidades", "menuLogout": "Cerrar sesión", "menuKeys": "Atajos clave", - "submitButton": "Botón de enviar" + "submitButton": "Botón de enviar", + "menuMedia": "Medios de comunicación", + "followButton": "Botón de seguimiento / dejo", + "blockButton": "Botón de bloqueo", + "infoButton": "Botón de información", + "snoozeButton": "El botón de dormitar", + "reportButton": "Botón de informe", + "viewButton": "Botón de vista", + "enterPetname": "Entrar en nombre de pettname", + "enterNotes": "Ingresar notas" } diff --git a/translations/fr.json b/translations/fr.json index 396c1e95f..7615ea636 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -427,5 +427,14 @@ "menuSkills": "Compétences", "menuLogout": "Se déconnecter", "menuKeys": "Raccourcis clés", - "submitButton": "Bouton de soumission" + "submitButton": "Bouton de soumission", + "menuMedia": "Médias", + "followButton": "Suivez / Bouton Suivi", + "blockButton": "Bouton de bloc", + "infoButton": "Bouton info", + "snoozeButton": "Le bouton de la sieste", + "reportButton": "Bouton de rapport", + "viewButton": "Bouton d'affichage", + "enterPetname": "Entrez PETNAME", + "enterNotes": "Faire entrer des notes" } diff --git a/translations/ga.json b/translations/ga.json index 6d2be022f..6e601cc41 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -427,5 +427,14 @@ "menuSkills": "Scileanna", "menuLogout": "Logáil Amach", "menuKeys": "Príomh-aicearraí", - "submitButton": "Cuir an cnaipe isteach" + "submitButton": "Cuir an cnaipe isteach", + "menuMedia": "Na meáin", + "followButton": "Lean / Cnaipe Unurollow", + "blockButton": "Cnaipe bloc", + "infoButton": "Cnaipe Info", + "snoozeButton": "Cnaipe snooze", + "reportButton": "Cnaipe Tuairisce", + "viewButton": "Féach an cnaipe", + "enterPetname": "Cuir isteach PetName", + "enterNotes": "Cuir nótaí isteach" } diff --git a/translations/hi.json b/translations/hi.json index 5f4880867..5e8b633c4 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -427,5 +427,14 @@ "menuSkills": "कौशल", "menuLogout": "लॉग आउट", "menuKeys": "कुंजी शॉर्टकट", - "submitButton": "जमा करने वाला बटन" + "submitButton": "जमा करने वाला बटन", + "menuMedia": "मीडिया", + "followButton": "फॉलो / अनफ़ॉलो बटन", + "blockButton": "ब्लॉक बटन", + "infoButton": "जानकारी बटन", + "snoozeButton": "अलार्म को थोड़ी देर बंद करने वाला बटन", + "reportButton": "रिपोर्ट बटन", + "viewButton": "देखें बटन", + "enterPetname": "PETNAME दर्ज करें", + "enterNotes": "नोट्स दर्ज करें" } diff --git a/translations/it.json b/translations/it.json index 0b055fed6..58753c309 100644 --- a/translations/it.json +++ b/translations/it.json @@ -427,5 +427,14 @@ "menuSkills": "Competenze", "menuLogout": "Disconnettersi", "menuKeys": "Scorciatoie chiave", - "submitButton": "Invia il pulsante" + "submitButton": "Invia il pulsante", + "menuMedia": "Media", + "followButton": "Segui il pulsante Segui / Unfollow", + "blockButton": "Blocco pulsante", + "infoButton": "Pulsante info", + "snoozeButton": "Pulsante snooze.", + "reportButton": "Pulsante report.", + "viewButton": "Visualizza il pulsante", + "enterPetname": "Inserisci PetName", + "enterNotes": "Inserisci le note" } diff --git a/translations/ja.json b/translations/ja.json index 359d700a9..7d9b3dc5f 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -427,5 +427,14 @@ "menuSkills": "スキル", "menuLogout": "ログアウト", "menuKeys": "キーショートカット", - "submitButton": "送信ボタン" + "submitButton": "送信ボタン", + "menuMedia": "メディア", + "followButton": "フォロー/フォローダウンボタン", + "blockButton": "ブロックボタン", + "infoButton": "情報ボタン", + "snoozeButton": "スヌーズボタン", + "reportButton": "レポートボタン", + "viewButton": "ボタンを見る", + "enterPetname": "PetNameを入力してください", + "enterNotes": "ノートを入力してください" } diff --git a/translations/ku.json b/translations/ku.json index 88dae41be..6675c75e0 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -427,5 +427,14 @@ "menuSkills": "Şarezayên", "menuLogout": "Derkeve", "menuKeys": "Kurteyên Key", - "submitButton": "Bişkojka bişînin" + "submitButton": "Bişkojka bişînin", + "menuMedia": "Medya", + "followButton": "Bişkojka bişopînin / Nexşe", + "blockButton": "Bişkojka Block", + "infoButton": "Bişkoja INFO", + "snoozeButton": "Bişkojka Snooze", + "reportButton": "Bişkoja Report", + "viewButton": "Bişkoja View", + "enterPetname": "Porê binivîse", + "enterNotes": "Nîşan binivîse" } diff --git a/translations/oc.json b/translations/oc.json index d47e16d11..7db236cfd 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -423,5 +423,14 @@ "menuSkills": "Skills", "menuLogout": "Logout", "menuKeys": "Key Shortcuts", - "submitButton": "Submit button" + "submitButton": "Submit button", + "menuMedia": "Media", + "followButton": "Follow/unfollow button", + "blockButton": "Block button", + "infoButton": "Info button", + "snoozeButton": "Snooze button", + "reportButton": "Report button", + "viewButton": "View button", + "enterPetname": "Enter petname", + "enterNotes": "Enter notes" } diff --git a/translations/pt.json b/translations/pt.json index 1fb1437bf..97966a384 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -427,5 +427,14 @@ "menuSkills": "Habilidades", "menuLogout": "Sair", "menuKeys": "Atalhos-chave", - "submitButton": "Botão de envio" + "submitButton": "Botão de envio", + "menuMedia": "meios de comunicação", + "followButton": "Siga / Deixar botão", + "blockButton": "Botão de bloco", + "infoButton": "Botão de informação", + "snoozeButton": "Botão Snooze", + "reportButton": "Botão de relatório", + "viewButton": "Botão de visualização", + "enterPetname": "Digite Petname", + "enterNotes": "Digite notas" } diff --git a/translations/ru.json b/translations/ru.json index 0d553527e..06b2994fc 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -427,5 +427,14 @@ "menuSkills": "Навыки и умения", "menuLogout": "Выйти", "menuKeys": "Клавичные ярлыки", - "submitButton": "Отправить кнопку" + "submitButton": "Отправить кнопку", + "menuMedia": "СМИ", + "followButton": "Следуйте / отписаться кнопка", + "blockButton": "Кнопка блокировки", + "infoButton": "Информация Кнопка", + "snoozeButton": "Кнопка сножения", + "reportButton": "Кнопка отчета", + "viewButton": "Кнопка просмотра", + "enterPetname": "Введите petname", + "enterNotes": "Введите ноты" } diff --git a/translations/zh.json b/translations/zh.json index 348b82b10..9fa5d1d4f 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -427,5 +427,14 @@ "menuSkills": "技能", "menuLogout": "登出", "menuKeys": "关键捷径", - "submitButton": "提交按钮" + "submitButton": "提交按钮", + "menuMedia": "媒体", + "followButton": "关注/取消关注按钮", + "blockButton": "块按钮", + "infoButton": "信息按钮", + "snoozeButton": "贪睡按钮", + "reportButton": "报告按钮", + "viewButton": "查看按钮", + "enterPetname": "进入宠物名", + "enterNotes": "输入笔记" } diff --git a/webapp_person_options.py b/webapp_person_options.py index 8019a87c1..5bd87de76 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -54,7 +54,8 @@ def htmlPersonOptions(defaultTimeline: str, alsoKnownAs: [], textModeBanner: str, newsInstance: bool, - authorized: bool) -> str: + authorized: bool, + accessKeys: {}) -> str: """Show options for a person: view/follow/block/report """ optionsDomain, optionsPort = getDomainFromActor(optionsActor) @@ -234,7 +235,8 @@ def htmlPersonOptions(defaultTimeline: str, optionsStr += \ ' ' + translate['Petname'] + ': \n' + \ ' \n' \ + petname + '" ' + \ + 'accesskey="' + accessKeys['enterPetname'] + '">\n' \ '
\n' @@ -324,40 +326,51 @@ def htmlPersonOptions(defaultTimeline: str, if authorized and originPathStr == '/users/' + nickname: optionsStr += \ ' \n' + 'class="buttonIcon" name="submitBack" ' + \ + 'accesskey="' + accessKeys['menuTimeline'] + '">' + \ + translate['Go Back'] + '\n' else: optionsStr += \ ' \n' if authorized: optionsStr += \ - ' \n' optionsStr += donateStr if authorized: optionsStr += \ ' \n' + followStr + '" accesskey="' + accessKeys['followButton'] + '">' + \ + translate[followStr] + '\n' optionsStr += \ ' \n' + blockStr + '" accesskey="' + accessKeys['blockButton'] + '">' + \ + translate[blockStr] + '\n' optionsStr += \ - ' \n' optionsStr += \ ' \n' optionsStr += \ ' \n' + 'name="submitReport" accesskey="' + \ + accessKeys['reportButton'] + '">' + \ + translate['Report'] + '\n' if isModerator(baseDir, nickname): optionsStr += \ ' \n' personNotes = '' @@ -376,7 +389,8 @@ def htmlPersonOptions(defaultTimeline: str, translate['Submit'] + '
\n' optionsStr += \ ' \n' optionsStr += ' \n' diff --git a/webapp_profile.py b/webapp_profile.py index c9112ae98..b8eb9d984 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -67,7 +67,8 @@ def htmlProfileAfterSearch(cssCache: {}, defaultTimeline: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - themeName: str) -> str: + themeName: str, + accessKeys: {}) -> str: """Show a profile page after a search for a fediverse address """ if hasUsersPath(profileHandle) or '/@' in profileHandle: @@ -255,7 +256,7 @@ def htmlProfileAfterSearch(cssCache: {}, profileDescriptionShort, avatarUrl, imageUrl, movedTo, profileJson['id'], - alsoKnownAs) + alsoKnownAs, accessKeys) domainFull = getFullDomain(domain, port) @@ -276,10 +277,12 @@ def htmlProfileAfterSearch(cssCache: {}, ' \n' profileStr += \ - ' \n' profileStr += \ - ' \n' profileStr += ' \n' profileStr += ' \n' @@ -331,14 +334,16 @@ def _getProfileHeader(baseDir: str, httpPrefix: str, loginButton: str, avatarUrl: str, theme: str, movedTo: str, alsoKnownAs: [], - pinnedContent) -> str: + pinnedContent: str, + accessKeys: {}) -> str: """The header of the profile screen, containing background image and avatar """ htmlStr = '\n\n
\n' htmlStr += ' \n' + translate['Switch to timeline view'] + '" ' + \ + 'accesskey="' + accessKeys['menuTimeline'] + '">\n' htmlStr += ' \n' @@ -411,14 +416,16 @@ def _getProfileHeaderAfterSearch(baseDir: str, profileDescriptionShort: str, avatarUrl: str, imageUrl: str, movedTo: str, actor: str, - alsoKnownAs: []) -> str: + alsoKnownAs: [], + accessKeys: {}) -> str: """The header of a searched for handle, containing background image and avatar """ htmlStr = '\n\n
\n' htmlStr += ' \n' + translate['Switch to timeline view'] + '" ' + \ + 'accesskey="' + accessKeys['menuTimeline'] + '">\n' htmlStr += ' \n' @@ -723,7 +730,7 @@ def htmlProfile(rssIconAtTop: bool, profileDescriptionShort, loginButton, avatarUrl, theme, movedTo, alsoKnownAs, - pinnedContent) + pinnedContent, accessKeys) # keyboard navigation userPathStr = '/users/' + nickname