Modifying reply dm for accommodation category

main
Bob Mottram 2021-09-19 17:54:32 +01:00
parent 8672c05bda
commit 0b2a881755
3 changed files with 35 additions and 16 deletions

View File

@ -2451,7 +2451,7 @@ class PubServer(BaseHTTPRequestHandler):
httpPrefix,
reportPath, None,
[optionsActor], None, None,
pageNumber,
pageNumber, '',
chooserNickname,
domain,
domainFull,
@ -2566,7 +2566,7 @@ class PubServer(BaseHTTPRequestHandler):
baseDir,
httpPrefix,
reportPath, None, [],
None, postUrl, pageNumber,
None, postUrl, pageNumber, '',
chooserNickname,
domain,
domainFull,
@ -11449,6 +11449,7 @@ class PubServer(BaseHTTPRequestHandler):
baseDir: str, httpPrefix: str,
inReplyToUrl: str, replyToList: [],
shareDescription: str, replyPageNumber: int,
replyCategory: str,
domain: str, domainFull: str,
GETstartTime, GETtimings: {}, cookie,
noDropDown: bool, conversationId: str) -> bool:
@ -11496,6 +11497,7 @@ class PubServer(BaseHTTPRequestHandler):
replyToList,
shareDescription, None,
replyPageNumber,
replyCategory,
nickname, domain,
domainFull,
self.server.defaultTimeline,
@ -13865,6 +13867,7 @@ class PubServer(BaseHTTPRequestHandler):
# replyWithDM = False
replyToList = []
replyPageNumber = 1
replyCategory = ''
shareDescription = None
conversationId = None
# replytoActor = None
@ -13934,6 +13937,8 @@ class PubServer(BaseHTTPRequestHandler):
replyPageStr = m.replace('page=', '')
if replyPageStr.isdigit():
replyPageNumber = int(replyPageStr)
elif m.startswith('category='):
replyCategory = m.replace('category=', '')
elif m.startswith('sharedesc:'):
# get the title for the shared item
shareDescription = \
@ -14041,6 +14046,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.httpPrefix,
inReplyToUrl, replyToList,
shareDescription, replyPageNumber,
replyCategory,
self.server.domain,
self.server.domainFull,
GETstartTime, GETtimings,

View File

@ -188,6 +188,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
mentions: [],
shareDescription: str,
reportUrl: str, pageNumber: int,
category: str,
nickname: str, domain: str,
domainFull: str,
defaultTimeline: str, newswire: {},
@ -211,13 +212,15 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
newPostText = '<h1>' + \
translate['Write your post text below.'] + '</h1>\n'
else:
newPostText = \
'<p class="new-post-text">' + \
translate['Write your reply to'] + \
' <a href="' + inReplyTo + \
'" rel="nofollow noopener noreferrer" ' + \
'target="_blank">' + \
translate['this post'] + '</a></p>\n'
newPostText = ''
if category != 'accommodation':
newPostText = \
'<p class="new-post-text">' + \
translate['Write your reply to'] + \
' <a href="' + inReplyTo + \
'" rel="nofollow noopener noreferrer" ' + \
'target="_blank">' + \
translate['this post'] + '</a></p>\n'
replyStr = '<input type="hidden" ' + \
'name="replyTo" value="' + inReplyTo + '">\n'
@ -308,7 +311,10 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
scopeIcon = 'scope_public.png'
scopeDescription = translate['Public']
if shareDescription:
placeholderSubject = translate['Ask about a shared item.'] + '..'
if category == 'accommodation':
placeholderSubject = translate['Request to stay']
else:
placeholderSubject = translate['Ask about a shared item.'] + '..'
else:
placeholderSubject = \
translate['Subject or Content Warning (optional)'] + '...'
@ -316,7 +322,9 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
if inReplyTo:
placeholderMentions = \
translate['Replying to'] + '...'
placeholderMessage = translate['Write something'] + '...'
placeholderMessage = ''
if category != 'accommodation':
placeholderMessage = translate['Write something'] + '...'
extraFields = ''
endpoint = 'newpost'
if path.endswith('/newblog'):
@ -528,11 +536,15 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
endpoint != 'newwanted' and \
endpoint != 'newreport' and \
endpoint != 'newquestion':
dateAndLocation = \
'<div class="container">\n' + \
'<p><input type="checkbox" class="profilecheckbox" ' + \
'name="commentsEnabled" checked><label class="labels"> ' + \
translate['Allow replies.'] + '</label></p>\n'
if category != 'accommodation':
dateAndLocation = \
'<div class="container">\n' + \
'<p><input type="checkbox" class="profilecheckbox" ' + \
'name="commentsEnabled" checked><label class="labels"> ' + \
translate['Allow replies.'] + '</label></p>\n'
else:
dateAndLocation = \
'<input type="hidden" name="commentsEnabled" value="true">\n'
if endpoint == 'newpost':
dateAndLocation += \

View File

@ -1340,6 +1340,7 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
'<p>' + \
'<a href="' + actor + '?replydm=sharedesc:' + \
sharedItem['displayName'] + ';mention=' + contactActor + \
';category=' + category + \
'"><button class="button">' + contactTitleStr + \
'</button></a>\n' + \
'<a href="' + contactActor + '"><button class="button">' + \