Modifying reply dm for accommodation category

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

View File

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

View File

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