mirror of https://gitlab.com/bashrc2/epicyon
Use post Id rather than full path
parent
634b66c59e
commit
3d5c437a74
14
daemon.py
14
daemon.py
|
@ -8108,16 +8108,21 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _editNewsPost(self, callingDomain: str, path: str,
|
def _editNewsPost(self, callingDomain: str, path: str,
|
||||||
translate: {}, baseDir: str,
|
translate: {}, baseDir: str,
|
||||||
httpPrefix: str, domain: str, port: int,
|
httpPrefix: str, domain: str, port: int,
|
||||||
|
domainFull: str,
|
||||||
cookie: str) -> bool:
|
cookie: str) -> bool:
|
||||||
"""Show the edit screen for a news post
|
"""Show the edit screen for a news post
|
||||||
"""
|
"""
|
||||||
if '/users/' in path and '/editnewspost=' in path:
|
if '/users/' in path and '/editnewspost=' in path:
|
||||||
postUrl = path.split('/editnewspost=')[1]
|
postId = path.split('/editnewspost=')[1]
|
||||||
if '?' in postUrl:
|
if '?' in postId:
|
||||||
postUrl = postUrl.split('?')[0]
|
postId = postId.split('?')[0]
|
||||||
|
postUrl = httpPrefix + '://' + domainFull + \
|
||||||
|
'/users/news/statuses' + postId
|
||||||
|
print('TEST postUrl: ' + postUrl)
|
||||||
msg = htmlEditNewsPost(translate, baseDir,
|
msg = htmlEditNewsPost(translate, baseDir,
|
||||||
path, domain, port,
|
path, domain, port,
|
||||||
httpPrefix, postUrl).encode('utf-8')
|
httpPrefix,
|
||||||
|
postUrl).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)
|
||||||
|
@ -9516,6 +9521,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix,
|
self.server.httpPrefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.port,
|
self.server.port,
|
||||||
|
self.server.domainFull,
|
||||||
cookie):
|
cookie):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -1371,8 +1371,9 @@ def htmlEditNewsPost(translate: {}, baseDir: str, path: str,
|
||||||
if not isEditor(baseDir, nickname):
|
if not isEditor(baseDir, nickname):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
postUrl = postUrl.replace('/', '#')
|
||||||
postFilename = locatePost(baseDir, nickname, domain, postUrl)
|
postFilename = locatePost(baseDir, nickname, domain, postUrl)
|
||||||
print('TEST htmlEditNewsPost 5: ' + str(postFilename))
|
print('TEST htmlEditNewsPost 5: ' + str(postFilename) + ' ' + postUrl)
|
||||||
if not postFilename:
|
if not postFilename:
|
||||||
return ''
|
return ''
|
||||||
postJsonObject = loadJson(postFilename)
|
postJsonObject = loadJson(postFilename)
|
||||||
|
@ -4623,7 +4624,7 @@ def individualPostAsHtml(allowDownloads: bool,
|
||||||
' ' + \
|
' ' + \
|
||||||
'<a class="imageAnchor" href="/users/' + \
|
'<a class="imageAnchor" href="/users/' + \
|
||||||
nickname + '/editnewspost=' + \
|
nickname + '/editnewspost=' + \
|
||||||
blogPostId.replace('/', '#') + \
|
blogPostId.split('/statuses/')[1] + \
|
||||||
'?actor=' + actorNickname + \
|
'?actor=' + actorNickname + \
|
||||||
'" title="' + translate['Edit blog post'] + '">' + \
|
'" title="' + translate['Edit blog post'] + '">' + \
|
||||||
'<img loading="lazy" title="' + \
|
'<img loading="lazy" title="' + \
|
||||||
|
|
Loading…
Reference in New Issue