diff --git a/blog.py b/blog.py index 0f429a43..a77939d3 100644 --- a/blog.py +++ b/blog.py @@ -529,3 +529,120 @@ def htmlBlogView(authorized: bool, \ return blogStr+htmlFooter() return None + +def htmlEditBlog(mediaInstance: bool,translate: {}, \ + baseDir: str,httpPrefix: str, \ + path: str, \ + pageNumber: int, \ + nickname: str,domain: str) -> str: + """Edit a blog post after it was created + """ + iconsDir=getIconsDir(baseDir) + + editBlogText='
'+translate['Write your post text below.']+'
' + + if os.path.isfile(baseDir+'/accounts/newpost.txt'): + with open(baseDir+'/accounts/newpost.txt', 'r') as file: + editBlogText = ''+file.read()+'
' + + cssFilename=baseDir+'/epicyon-profile.css' + if os.path.isfile(baseDir+'/epicyon.css'): + cssFilename=baseDir+'/epicyon.css' + with open(cssFilename, 'r') as cssFile: + editBlogCSS = cssFile.read() + if httpPrefix!='https': + editBlogCSS=editBlogCSS.replace('https://',httpPrefix+'://') + + if '?' in path: + path=path.split('?')[0] + pathBase= \ + path.replace('/editblogpost','') + + editBlogImageSection ='' + dateAndLocation+='' + dateAndLocation+='' + dateAndLocation+='
' + dateAndLocation+='