mirror of https://gitlab.com/bashrc2/epicyon
Custom new post submit button text
parent
1a410dd8ca
commit
d8dff6e804
37
daemon.py
37
daemon.py
|
@ -2324,6 +2324,10 @@ 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 +2341,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 +2438,10 @@ 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 +2454,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 +4450,22 @@ 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 +10447,10 @@ 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 +10465,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()
|
||||
|
|
|
@ -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'
|
||||
|
@ -776,7 +779,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
|||
newPostForm += ' <div class="container">\n'
|
||||
newPostForm += \
|
||||
' <input type="submit" name="submitPost" value="' + \
|
||||
translate['Submit'] + '">\n'
|
||||
submitText + '">\n'
|
||||
newPostForm += ' </div>\n'
|
||||
|
||||
newPostForm += ' </div>\n'
|
||||
|
|
|
@ -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>'
|
||||
|
|
Loading…
Reference in New Issue