Banner for editing newswire

main
Bob Mottram 2020-11-02 17:58:35 +00:00
parent 9d610c2fdc
commit 6dc74e7066
2 changed files with 16 additions and 2 deletions

View File

@ -8569,7 +8569,8 @@ class PubServer(BaseHTTPRequestHandler):
baseDir,
path, domain,
port,
httpPrefix).encode('utf-8')
httpPrefix,
self.server.defaultTimeline).encode('utf-8')
if msg:
self._set_headers('text/html', len(msg),
cookie, callingDomain)

View File

@ -1295,7 +1295,8 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
domain: str, port: int, httpPrefix: str) -> str:
domain: str, port: int, httpPrefix: str,
defaultTimeline: str) -> str:
"""Shows the edit newswire screen
"""
if '/users/' not in path:
@ -1322,7 +1323,19 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
editCSS = \
editCSS.replace('https://', httpPrefix + '://')
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
editNewswireForm = htmlHeader(cssFilename, editCSS)
# top banner
editNewswireForm += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '">\n'
editNewswireForm += '<img loading="lazy" class="timeline-banner" src="' + \
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
editNewswireForm += \
'<form enctype="multipart/form-data" method="POST" ' + \
'accept-charset="UTF-8" action="' + path + '/newswiredata">\n'