Remove back buttons from edit newswire and links

main
Bob Mottram 2020-11-02 18:06:07 +00:00
parent 6dc74e7066
commit c3d43c0a4a
2 changed files with 32 additions and 16 deletions

View File

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

View File

@ -1226,12 +1226,12 @@ def scheduledPostsExist(baseDir: str, nickname: str, domain: str) -> bool:
def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, def htmlEditLinks(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 links screen """Shows the edit links screen
""" """
if '/users/' not in path: if '/users/' not in path:
return '' return ''
pathOriginal = path
path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/inbox', '').replace('/outbox', '')
path = path.replace('/shares', '') path = path.replace('/shares', '')
@ -1253,7 +1253,19 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
editCSS = \ editCSS = \
editCSS.replace('https://', httpPrefix + '://') editCSS.replace('https://', httpPrefix + '://')
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
editLinksForm = htmlHeader(cssFilename, editCSS) editLinksForm = htmlHeader(cssFilename, editCSS)
# top banner
editLinksForm += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '">\n'
editLinksForm += '<img loading="lazy" class="timeline-banner" src="' + \
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
editLinksForm += \ editLinksForm += \
'<form enctype="multipart/form-data" method="POST" ' + \ '<form enctype="multipart/form-data" method="POST" ' + \
'accept-charset="UTF-8" action="' + path + '/linksdata">\n' 'accept-charset="UTF-8" action="' + path + '/linksdata">\n'
@ -1263,12 +1275,14 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
' <p class="new-post-text">' + translate['Edit Links'] + '</p>' ' <p class="new-post-text">' + translate['Edit Links'] + '</p>'
editLinksForm += \ editLinksForm += \
' <div class="container">\n' ' <div class="container">\n'
# editLinksForm += \
# ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
# translate['Go Back'] + '</button></a>\n'
editLinksForm += \ editLinksForm += \
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \ ' <center>\n' + \
translate['Go Back'] + '</button></a>\n'
editLinksForm += \
' <input type="submit" name="submitLinks" value="' + \ ' <input type="submit" name="submitLinks" value="' + \
translate['Submit'] + '">\n' translate['Submit'] + '">\n' + \
' <center>\n'
editLinksForm += \ editLinksForm += \
' </div>\n' ' </div>\n'
@ -1301,7 +1315,6 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
""" """
if '/users/' not in path: if '/users/' not in path:
return '' return ''
pathOriginal = path
path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/inbox', '').replace('/outbox', '')
path = path.replace('/shares', '') path = path.replace('/shares', '')
@ -1345,12 +1358,14 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
' <p class="new-post-text">' + translate['Edit newswire'] + '</p>' ' <p class="new-post-text">' + translate['Edit newswire'] + '</p>'
editNewswireForm += \ editNewswireForm += \
' <div class="container">\n' ' <div class="container">\n'
# editNewswireForm += \
# ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
# translate['Go Back'] + '</button></a>\n'
editNewswireForm += \ editNewswireForm += \
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \ ' <center>\n' + \
translate['Go Back'] + '</button></a>\n'
editNewswireForm += \
' <input type="submit" name="submitNewswire" value="' + \ ' <input type="submit" name="submitNewswire" value="' + \
translate['Submit'] + '">\n' translate['Submit'] + '">\n' + \
' <center>\n'
editNewswireForm += \ editNewswireForm += \
' </div>\n' ' </div>\n'
@ -1813,8 +1828,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
# top banner # top banner
editProfileForm += \ editProfileForm += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \ '<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to profile view'] + '" alt="' + \ translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to profile view'] + '">\n' translate['Switch to timeline view'] + '">\n'
editProfileForm += '<img loading="lazy" class="timeline-banner" src="' + \ editProfileForm += '<img loading="lazy" class="timeline-banner" src="' + \
'/users/' + nickname + '/' + bannerFile + '" /></a>\n' '/users/' + nickname + '/' + bannerFile + '" /></a>\n'