Compare using custom submit button text

merge-requests/30/head
Bob Mottram 2021-05-30 18:55:19 +01:00
parent d83528cb1a
commit 2a62dd7e26
2 changed files with 16 additions and 13 deletions

View File

@ -2324,9 +2324,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname): if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname] accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = \ customSubmitText = getConfigParam(baseDir, 'customSubmitText')
getConfigParam(baseDir,
'customSubmitText')
msg = htmlNewPost(self.server.cssCache, msg = htmlNewPost(self.server.cssCache,
False, self.server.translate, False, self.server.translate,
@ -2438,9 +2436,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname): if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname] accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = \ customSubmitText = getConfigParam(baseDir, 'customSubmitText')
getConfigParam(baseDir,
'customSubmitText')
msg = htmlNewPost(self.server.cssCache, msg = htmlNewPost(self.server.cssCache,
False, self.server.translate, False, self.server.translate,
@ -4452,8 +4448,7 @@ class PubServer(BaseHTTPRequestHandler):
# change custom post submit button text # change custom post submit button text
currCustomSubmitText = \ currCustomSubmitText = \
getConfigParam(baseDir, getConfigParam(baseDir, 'customSubmitText')
'customSubmitText')
if fields.get('customSubmitText'): if fields.get('customSubmitText'):
if fields['customSubmitText'] != \ if fields['customSubmitText'] != \
currCustomSubmitText: currCustomSubmitText:
@ -10447,9 +10442,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname): if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname] accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = \ customSubmitText = getConfigParam(baseDir, 'customSubmitText')
getConfigParam(baseDir,
'customSubmitText')
msg = htmlNewPost(self.server.cssCache, msg = htmlNewPost(self.server.cssCache,
mediaInstance, mediaInstance,
@ -13325,9 +13318,13 @@ class PubServer(BaseHTTPRequestHandler):
not fields.get('pinToProfile'): not fields.get('pinToProfile'):
print('WARN: no message, image description or pin') print('WARN: no message, image description or pin')
return -1 return -1
submitText = self.server.translate['Submit']
customSubmitText = \
getConfigParam(self.server.baseDir, 'customSubmitText')
if customSubmitText:
submitText = customSubmitText
if fields.get('submitPost'): if fields.get('submitPost'):
if fields['submitPost'] != \ if fields['submitPost'] != submitText:
self.server.translate['Submit']:
print('WARN: no submit field ' + fields['submitPost']) print('WARN: no submit field ' + fields['submitPost'])
return -1 return -1
else: else:

View File

@ -776,6 +776,12 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
if not mediaInstance or replyStr: if not mediaInstance or replyStr:
newPostForm += newPostImageSection newPostForm += newPostImageSection
newPostForm += ' <div class="container">\n'
newPostForm += \
' <input type="submit" name="submitPost" value="' + \
submitText + '">\n'
newPostForm += ' </div>\n'
newPostForm += ' </div>\n' newPostForm += ' </div>\n'
newPostForm += '</form>\n' newPostForm += '</form>\n'