Change blog terminology for news instances

main
Bob Mottram 2020-10-27 17:54:10 +00:00
parent 7f5dd17f48
commit 94aec1a6c4
2 changed files with 31 additions and 13 deletions

View File

@ -1822,7 +1822,8 @@ class PubServer(BaseHTTPRequestHandler):
pageNumber,
chooserNickname,
domain,
domainFull).encode('utf-8')
domainFull,
self.server.defaultTimeline).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -1887,7 +1888,8 @@ class PubServer(BaseHTTPRequestHandler):
postUrl, pageNumber,
chooserNickname,
domain,
domainFull).encode('utf-8')
domainFull,
self.server.defaultTimeline).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -8415,7 +8417,8 @@ class PubServer(BaseHTTPRequestHandler):
shareDescription,
replyPageNumber,
nickname, domain,
domainFull).encode('utf-8')
domainFull,
self.server.defaultTimeline).encode('utf-8')
if not msg:
print('Error replying to ' + inReplyToUrl)
self._404()

View File

@ -2352,7 +2352,8 @@ def htmlNewPost(mediaInstance: bool, translate: {},
mentions: [],
reportUrl: str, pageNumber: int,
nickname: str, domain: str,
domainFull: str) -> str:
domainFull: str,
defaultTimeline: str) -> str:
"""New post screen
"""
iconsDir = getIconsDir(baseDir)
@ -2490,7 +2491,10 @@ def htmlNewPost(mediaInstance: bool, translate: {},
if path.endswith('/newblog'):
placeholderSubject = translate['Title']
scopeIcon = 'scope_blog.png'
scopeDescription = translate['Blog']
if defaultTimeline != 'tlnews':
scopeDescription = translate['Blog']
else:
scopeDescription = translate['Article']
endpoint = 'newblog'
elif path.endswith('/newunlisted'):
scopeIcon = 'scope_unlisted.png'
@ -2803,12 +2807,20 @@ def htmlNewPost(mediaInstance: bool, translate: {},
iconsDir + '/scope_public.png"/><b>' + \
translate['Public'] + '</b><br>' + \
translate['Visible to anyone'] + '</li></a>\n'
dropDownContent += " " \
'<a href="' + pathBase + dropdownNewBlogSuffix + \
'"><li><img loading="lazy" alt="" title="" src="/' + \
iconsDir + '/scope_blog.png"/><b>' + \
translate['Blog'] + '</b><br>' + \
translate['Publicly visible post'] + '</li></a>\n'
if defaultTimeline != 'tlnews':
dropDownContent += " " \
'<a href="' + pathBase + dropdownNewBlogSuffix + \
'"><li><img loading="lazy" alt="" title="" src="/' + \
iconsDir + '/scope_blog.png"/><b>' + \
translate['Article'] + '</b><br>' + \
translate['Create an article'] + '</li></a>\n'
else:
dropDownContent += " " \
'<a href="' + pathBase + dropdownNewBlogSuffix + \
'"><li><img loading="lazy" alt="" title="" src="/' + \
iconsDir + '/scope_blog.png"/><b>' + \
translate['Blog'] + '</b><br>' + \
translate['Publicly visible post'] + '</li></a>\n'
dropDownContent += " " \
'<a href="' + pathBase + dropdownUnlistedSuffix + \
'"><li><img loading="lazy" alt="" title="" src="/' + \
@ -5987,7 +5999,7 @@ def getTimelineButtonHeader(defaultTimeline: str,
tlStr += \
' <a href="' + usersPath + \
'/tlnews"><button class="' + \
newsButton + '"><span>' + translate['News'] + \
newsButton + '"><span>' + translate['Features'] + \
'</span></button></a>\n'
else:
tlStr += \
@ -6034,10 +6046,13 @@ def getTimelineButtonHeader(defaultTimeline: str,
# but may change if this is a blogging oriented instance
if defaultTimeline != 'tlblogs':
if not minimal or defaultTimeline == 'tlnews':
titleStr = translate['Blogs']
if defaultTimeline == 'tlnews':
titleStr = translate['Article']
tlStr += \
' <a href="' + usersPath + \
'/tlblogs"><button class="' + \
blogsButton + '"><span>' + translate['Blogs'] + \
blogsButton + '"><span>' + titleStr + \
'</span></button></a>\n'
else:
if not minimal: