mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon
commit
b4ef50caaa
46
daemon.py
46
daemon.py
|
|
@ -2324,6 +2324,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if self.server.keyShortcuts.get(nickname):
|
||||
accessKeys = self.server.keyShortcuts[nickname]
|
||||
|
||||
customSubmitText = getConfigParam(baseDir, 'customSubmitText')
|
||||
|
||||
msg = htmlNewPost(self.server.cssCache,
|
||||
False, self.server.translate,
|
||||
baseDir,
|
||||
|
|
@ -2337,7 +2339,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.defaultTimeline,
|
||||
self.server.newswire,
|
||||
self.server.themeName,
|
||||
True, accessKeys).encode('utf-8')
|
||||
True, accessKeys,
|
||||
customSubmitText).encode('utf-8')
|
||||
msglen = len(msg)
|
||||
self._set_headers('text/html', msglen,
|
||||
cookie, callingDomain)
|
||||
|
|
@ -2433,6 +2436,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if self.server.keyShortcuts.get(nickname):
|
||||
accessKeys = self.server.keyShortcuts[nickname]
|
||||
|
||||
customSubmitText = getConfigParam(baseDir, 'customSubmitText')
|
||||
|
||||
msg = htmlNewPost(self.server.cssCache,
|
||||
False, self.server.translate,
|
||||
baseDir,
|
||||
|
|
@ -2445,7 +2450,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.defaultTimeline,
|
||||
self.server.newswire,
|
||||
self.server.themeName,
|
||||
True, accessKeys).encode('utf-8')
|
||||
True, accessKeys,
|
||||
customSubmitText).encode('utf-8')
|
||||
msglen = len(msg)
|
||||
self._set_headers('text/html', msglen,
|
||||
cookie, callingDomain)
|
||||
|
|
@ -4440,6 +4446,21 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
'youtubedomain', '')
|
||||
self.server.YTReplacementDomain = None
|
||||
|
||||
# change custom post submit button text
|
||||
currCustomSubmitText = \
|
||||
getConfigParam(baseDir, 'customSubmitText')
|
||||
if fields.get('customSubmitText'):
|
||||
if fields['customSubmitText'] != \
|
||||
currCustomSubmitText:
|
||||
customText = fields['customSubmitText']
|
||||
setConfigParam(baseDir,
|
||||
'customSubmitText',
|
||||
customText)
|
||||
else:
|
||||
if currCustomSubmitText:
|
||||
setConfigParam(baseDir,
|
||||
'customSubmitText', '')
|
||||
|
||||
# change instance description
|
||||
currInstanceDescriptionShort = \
|
||||
getConfigParam(baseDir,
|
||||
|
|
@ -10421,6 +10442,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if self.server.keyShortcuts.get(nickname):
|
||||
accessKeys = self.server.keyShortcuts[nickname]
|
||||
|
||||
customSubmitText = getConfigParam(baseDir, 'customSubmitText')
|
||||
|
||||
msg = htmlNewPost(self.server.cssCache,
|
||||
mediaInstance,
|
||||
translate,
|
||||
|
|
@ -10435,7 +10458,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.defaultTimeline,
|
||||
self.server.newswire,
|
||||
self.server.themeName,
|
||||
noDropDown, accessKeys).encode('utf-8')
|
||||
noDropDown, accessKeys,
|
||||
customSubmitText).encode('utf-8')
|
||||
if not msg:
|
||||
print('Error replying to ' + inReplyToUrl)
|
||||
self._404()
|
||||
|
|
@ -10465,6 +10489,12 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
city = self._getSpoofedCity(baseDir, nickname, domain)
|
||||
else:
|
||||
city = self.server.city
|
||||
|
||||
accessKeys = self.server.accessKeys
|
||||
if '/users/' in path:
|
||||
if self.server.keyShortcuts.get(nickname):
|
||||
accessKeys = self.server.keyShortcuts[nickname]
|
||||
|
||||
msg = htmlEditProfile(self.server.cssCache,
|
||||
translate,
|
||||
baseDir,
|
||||
|
|
@ -10475,7 +10505,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.themeName,
|
||||
peertubeInstances,
|
||||
self.server.textModeBanner,
|
||||
city).encode('utf-8')
|
||||
city, accessKeys).encode('utf-8')
|
||||
if msg:
|
||||
msglen = len(msg)
|
||||
self._set_headers('text/html', msglen,
|
||||
|
|
@ -13288,9 +13318,13 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
not fields.get('pinToProfile'):
|
||||
print('WARN: no message, image description or pin')
|
||||
return -1
|
||||
submitText = self.server.translate['Submit']
|
||||
customSubmitText = \
|
||||
getConfigParam(self.server.baseDir, 'customSubmitText')
|
||||
if customSubmitText:
|
||||
submitText = customSubmitText
|
||||
if fields.get('submitPost'):
|
||||
if fields['submitPost'] != \
|
||||
self.server.translate['Submit']:
|
||||
if fields['submitPost'] != submitText:
|
||||
print('WARN: no submit field ' + fields['submitPost'])
|
||||
return -1
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "الفنانين",
|
||||
"Graphic Design": "التصميم الجرافيكي",
|
||||
"Import Theme": "استيراد الموضوع",
|
||||
"Export Theme": "موضوع التصدير"
|
||||
"Export Theme": "موضوع التصدير",
|
||||
"Custom post submit button text": "عرف نشر إرسال نص زر"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artistes",
|
||||
"Graphic Design": "Disseny gràfic",
|
||||
"Import Theme": "Importació temàtica",
|
||||
"Export Theme": "Tema d'exportació"
|
||||
"Export Theme": "Tema d'exportació",
|
||||
"Custom post submit button text": "Text de botó d'enviament de publicacions personalitzades"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artistiaid",
|
||||
"Graphic Design": "Dylunio Graffig",
|
||||
"Import Theme": "Thema Mewnforio",
|
||||
"Export Theme": "Thema Allforio"
|
||||
"Export Theme": "Thema Allforio",
|
||||
"Custom post submit button text": "Testun Post Post Post"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Künstler",
|
||||
"Graphic Design": "Grafikdesign",
|
||||
"Import Theme": "Theme importieren",
|
||||
"Export Theme": "Theme exportieren"
|
||||
"Export Theme": "Theme exportieren",
|
||||
"Custom post submit button text": "Benutzerdefinierte Post-Senden Schaltfläche Text"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artists",
|
||||
"Graphic Design": "Graphic Design",
|
||||
"Import Theme": "Import Theme",
|
||||
"Export Theme": "Export Theme"
|
||||
"Export Theme": "Export Theme",
|
||||
"Custom post submit button text": "Custom post submit button text"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artistas",
|
||||
"Graphic Design": "Diseño gráfico",
|
||||
"Import Theme": "Tema de importación",
|
||||
"Export Theme": "Tema de exportación"
|
||||
"Export Theme": "Tema de exportación",
|
||||
"Custom post submit button text": "POST POST PERSONALIZADO Botón Texto"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artistes",
|
||||
"Graphic Design": "Conception graphique",
|
||||
"Import Theme": "Import thème",
|
||||
"Export Theme": "Thème d'exportation"
|
||||
"Export Theme": "Thème d'exportation",
|
||||
"Custom post submit button text": "Texte de bouton d'envoi postal personnalisé"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Ealaíontóirí",
|
||||
"Graphic Design": "Dearadh grafach",
|
||||
"Import Theme": "Téama Iompórtáil",
|
||||
"Export Theme": "Téama Easpórtála"
|
||||
"Export Theme": "Téama Easpórtála",
|
||||
"Custom post submit button text": "Post saincheaptha Cuir isteach an cnaipe Téacs"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "कलाकार की",
|
||||
"Graphic Design": "ग्राफ़िक डिज़ाइन",
|
||||
"Import Theme": "आयात विषय",
|
||||
"Export Theme": "निर्यात विषय"
|
||||
"Export Theme": "निर्यात विषय",
|
||||
"Custom post submit button text": "कस्टम पोस्ट सबमिट बटन टेक्स्ट"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artiste",
|
||||
"Graphic Design": "Graphic design",
|
||||
"Import Theme": "Tema dell'importazione",
|
||||
"Export Theme": "Esportare tema"
|
||||
"Export Theme": "Esportare tema",
|
||||
"Custom post submit button text": "Pulsante di invio del post personalizzato"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "アーティスト",
|
||||
"Graphic Design": "グラフィックデザイン",
|
||||
"Import Theme": "輸入テーマ",
|
||||
"Export Theme": "テーマをエクスポートします"
|
||||
"Export Theme": "テーマをエクスポートします",
|
||||
"Custom post submit button text": "カスタムポスト送信ボタンテキスト"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Hunermend",
|
||||
"Graphic Design": "Sêwirana grafîkî",
|
||||
"Import Theme": "Mijara Import",
|
||||
"Export Theme": "Mijara Export"
|
||||
"Export Theme": "Mijara Export",
|
||||
"Custom post submit button text": "Nivîsa bişkojka paşîn a paşîn"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -442,5 +442,6 @@
|
|||
"Artists": "Artists",
|
||||
"Graphic Design": "Graphic Design",
|
||||
"Import Theme": "Import Theme",
|
||||
"Export Theme": "Export Theme"
|
||||
"Export Theme": "Export Theme",
|
||||
"Custom post submit button text": "Custom post submit button text"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Artistas",
|
||||
"Graphic Design": "Design gráfico",
|
||||
"Import Theme": "Importar tema",
|
||||
"Export Theme": "Exportar tema"
|
||||
"Export Theme": "Exportar tema",
|
||||
"Custom post submit button text": "Texto de botão de envio de post personalizado"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "Художники",
|
||||
"Graphic Design": "Графический дизайн",
|
||||
"Import Theme": "Импортировать тему",
|
||||
"Export Theme": "Экспортная тема"
|
||||
"Export Theme": "Экспортная тема",
|
||||
"Custom post submit button text": "Пользовательский пост Отправить кнопку текста"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,5 +446,6 @@
|
|||
"Artists": "艺人",
|
||||
"Graphic Design": "平面设计",
|
||||
"Import Theme": "进口主题",
|
||||
"Export Theme": "出口主题"
|
||||
"Export Theme": "出口主题",
|
||||
"Custom post submit button text": "自定义发布提交按钮文本"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
|||
domainFull: str,
|
||||
defaultTimeline: str, newswire: {},
|
||||
theme: str, noDropDown: bool,
|
||||
accessKeys: {}) -> str:
|
||||
accessKeys: {}, customSubmitText: str) -> str:
|
||||
"""New post screen
|
||||
"""
|
||||
replyStr = ''
|
||||
|
|
@ -702,9 +702,12 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
|||
' <td><input type="submit" name="submitCitations" value="' + \
|
||||
translate['Citations'] + '"></td>\n'
|
||||
|
||||
submitText = translate['Submit']
|
||||
if customSubmitText:
|
||||
submitText = customSubmitText
|
||||
newPostForm += \
|
||||
' <td><input type="submit" name="submitPost" value="' + \
|
||||
translate['Submit'] + '" ' + \
|
||||
submitText + '" ' + \
|
||||
'accesskey="' + accessKeys['submitButton'] + '"></td>\n'
|
||||
|
||||
newPostForm += ' </tr>\n'
|
||||
|
|
@ -772,6 +775,13 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
|||
newPostForm += extraFields + citationsStr + dateAndLocation
|
||||
if not mediaInstance or replyStr:
|
||||
newPostForm += newPostImageSection
|
||||
|
||||
newPostForm += ' <div class="container">\n'
|
||||
newPostForm += \
|
||||
' <input type="submit" name="submitPost" value="' + \
|
||||
submitText + '">\n'
|
||||
newPostForm += ' </div>\n'
|
||||
|
||||
newPostForm += ' </div>\n'
|
||||
newPostForm += '</form>\n'
|
||||
|
||||
|
|
|
|||
|
|
@ -353,8 +353,7 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
|
|||
htmlStr = '\n\n <figure class="profileHeader">\n'
|
||||
htmlStr += ' <a href="/users/' + \
|
||||
nickname + '/' + defaultTimeline + '" title="' + \
|
||||
translate['Switch to timeline view'] + '" ' + \
|
||||
'accesskey="' + accessKeys['menuTimeline'] + '">\n'
|
||||
translate['Switch to timeline view'] + '">\n'
|
||||
htmlStr += ' <img class="profileBackground" ' + \
|
||||
'alt="" ' + \
|
||||
'src="/users/' + nickname + '/image_' + theme + '.png" /></a>\n'
|
||||
|
|
@ -1081,7 +1080,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
domain: str, port: int, httpPrefix: str,
|
||||
defaultTimeline: str, theme: str,
|
||||
peertubeInstances: [],
|
||||
textModeBanner: str, city: str) -> str:
|
||||
textModeBanner: str, city: str,
|
||||
accessKeys: {}) -> str:
|
||||
"""Shows the edit profile screen
|
||||
"""
|
||||
imageFormats = getImageFormats()
|
||||
|
|
@ -1359,6 +1359,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
# Instance details section
|
||||
instanceDescription = \
|
||||
getConfigParam(baseDir, 'instanceDescription')
|
||||
customSubmitText = \
|
||||
getConfigParam(baseDir, 'customSubmitText')
|
||||
instanceDescriptionShort = \
|
||||
getConfigParam(baseDir, 'instanceDescriptionShort')
|
||||
instanceTitle = \
|
||||
|
|
@ -1401,6 +1403,20 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
instanceStr += \
|
||||
' <textarea id="message" name="instanceDescription" ' + \
|
||||
'style="height:200px" spellcheck="true"></textarea>'
|
||||
|
||||
instanceStr += \
|
||||
' <label class="labels">' + \
|
||||
translate['Custom post submit button text'] + '</label>'
|
||||
if customSubmitText:
|
||||
instanceStr += \
|
||||
' <input type="text" ' + \
|
||||
'name="customSubmitText" value="' + \
|
||||
customSubmitText + '"><br>'
|
||||
else:
|
||||
instanceStr += \
|
||||
' <input type="text" ' + \
|
||||
'name="customSubmitText" value=""><br>'
|
||||
|
||||
instanceStr += \
|
||||
' <label class="labels">' + \
|
||||
translate['Instance Logo'] + '</label>'
|
||||
|
|
@ -1611,8 +1627,9 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
editProfileForm += ' <div class="container">\n'
|
||||
editProfileForm += \
|
||||
' <center>\n' + \
|
||||
' <input type="submit" name="submitProfile" value="' + \
|
||||
translate['Submit'] + '">\n' + \
|
||||
' <input type="submit" name="submitProfile" ' + \
|
||||
'accesskey="' + accessKeys['submitButton'] + '" ' + \
|
||||
'value="' + translate['Submit'] + '">\n' + \
|
||||
' </center>\n'
|
||||
editProfileForm += ' </div>\n'
|
||||
|
||||
|
|
@ -1983,6 +2000,15 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
'name="deactivateThisAccount"> ' + \
|
||||
translate['Deactivate this account'] + '<br>\n'
|
||||
editProfileForm += ' </div></details>\n'
|
||||
|
||||
editProfileForm += ' <div class="container">\n'
|
||||
editProfileForm += \
|
||||
' <center>\n' + \
|
||||
' <input type="submit" name="submitProfile" value="' + \
|
||||
translate['Submit'] + '">\n' + \
|
||||
' </center>\n'
|
||||
editProfileForm += ' </div>\n'
|
||||
|
||||
editProfileForm += ' </div>\n'
|
||||
editProfileForm += '</form>\n'
|
||||
editProfileForm += htmlFooter()
|
||||
|
|
|
|||
Loading…
Reference in New Issue