forked from indymedia/epicyon
Blog separator variable
parent
42c673e508
commit
fa55703091
18
blog.py
18
blog.py
|
@ -149,7 +149,8 @@ def htmlBlogPostContent(authorized: bool,
|
||||||
baseDir: str, httpPrefix: str, translate: {},
|
baseDir: str, httpPrefix: str, translate: {},
|
||||||
nickname: str, domain: str, domainFull: str,
|
nickname: str, domain: str, domainFull: str,
|
||||||
postJsonObject: {},
|
postJsonObject: {},
|
||||||
handle: str, restrictToDomain: bool) -> str:
|
handle: str, restrictToDomain: bool,
|
||||||
|
blogSeparator='<hr>') -> str:
|
||||||
"""Returns the content for a single blog post
|
"""Returns the content for a single blog post
|
||||||
"""
|
"""
|
||||||
linkedAuthor = False
|
linkedAuthor = False
|
||||||
|
@ -236,12 +237,21 @@ def htmlBlogPostContent(authorized: bool,
|
||||||
replies = noOfBlogReplies(baseDir, httpPrefix, translate,
|
replies = noOfBlogReplies(baseDir, httpPrefix, translate,
|
||||||
nickname, domain, domainFull,
|
nickname, domain, domainFull,
|
||||||
postJsonObject['object']['id'])
|
postJsonObject['object']['id'])
|
||||||
if replies > 0:
|
|
||||||
|
# separator between blogs should be centered
|
||||||
|
if '<center>' not in blogSeparator:
|
||||||
|
blogSeparator = '<center>' + blogSeparator + '</center>'
|
||||||
|
|
||||||
|
if replies == 0:
|
||||||
|
blogStr += blogSeparator + '\n'
|
||||||
|
return blogStr
|
||||||
|
|
||||||
if not authorized:
|
if not authorized:
|
||||||
blogStr += '<p class="blogreplies">' + \
|
blogStr += '<p class="blogreplies">' + \
|
||||||
translate['Replies'].lower() + ': ' + str(replies) + '</p>'
|
translate['Replies'].lower() + ': ' + str(replies) + '</p>'
|
||||||
|
blogStr += '<br><br><br>' + blogSeparator + '\n'
|
||||||
else:
|
else:
|
||||||
blogStr += '<h1>' + translate['Replies'] + '</h1>\n'
|
blogStr += blogSeparator + '<h1>' + translate['Replies'] + '</h1>\n'
|
||||||
blogStr += '<script>' + contentWarningScriptOpen() + '</script>\n'
|
blogStr += '<script>' + contentWarningScriptOpen() + '</script>\n'
|
||||||
if not titleStr:
|
if not titleStr:
|
||||||
blogStr += getBlogReplies(baseDir, httpPrefix, translate,
|
blogStr += getBlogReplies(baseDir, httpPrefix, translate,
|
||||||
|
@ -252,7 +262,7 @@ def htmlBlogPostContent(authorized: bool,
|
||||||
nickname, domain, domainFull,
|
nickname, domain, domainFull,
|
||||||
postJsonObject['object']['id'])
|
postJsonObject['object']['id'])
|
||||||
blogStr += blogRepliesStr.replace('>' + titleStr + '<', '')
|
blogStr += blogRepliesStr.replace('>' + titleStr + '<', '')
|
||||||
blogStr += '<br><br><hr>\n'
|
|
||||||
return blogStr
|
return blogStr
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue