forked from indymedia/epicyon
Remove the CW button from blog posts
parent
0c1df23d13
commit
e81f7e618e
14
blog.py
14
blog.py
|
@ -316,6 +316,18 @@ def htmlBlogPostRSS3(authorized: bool,
|
||||||
return rssStr
|
return rssStr
|
||||||
|
|
||||||
|
|
||||||
|
def htmlBlogRemoveCwButton(blogStr: str, translate: {}) -> str:
|
||||||
|
"""Removes the CW button from blog posts, where the
|
||||||
|
summary field is instead used as the blog title
|
||||||
|
"""
|
||||||
|
blogStr = blogStr.replace('<details>', '<b>')
|
||||||
|
blogStr = blogStr.replace('</details>', '</b>')
|
||||||
|
blogStr = blogStr.replace('<summary>', '')
|
||||||
|
blogStr = blogStr.replace('</summary>', '')
|
||||||
|
blogStr = blogStr.replace(translate['SHOW MORE'], '')
|
||||||
|
return blogStr
|
||||||
|
|
||||||
|
|
||||||
def htmlBlogPost(authorized: bool,
|
def htmlBlogPost(authorized: bool,
|
||||||
baseDir: str, httpPrefix: str, translate: {},
|
baseDir: str, httpPrefix: str, translate: {},
|
||||||
nickname: str, domain: str, domainFull: str,
|
nickname: str, domain: str, domainFull: str,
|
||||||
|
@ -330,6 +342,7 @@ def htmlBlogPost(authorized: bool,
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
blogCSS = cssFile.read()
|
blogCSS = cssFile.read()
|
||||||
blogStr = htmlHeader(cssFilename, blogCSS)
|
blogStr = htmlHeader(cssFilename, blogCSS)
|
||||||
|
htmlBlogRemoveCwButton(blogStr, translate)
|
||||||
|
|
||||||
blogStr += htmlBlogPostContent(authorized, baseDir,
|
blogStr += htmlBlogPostContent(authorized, baseDir,
|
||||||
httpPrefix, translate,
|
httpPrefix, translate,
|
||||||
|
@ -376,6 +389,7 @@ def htmlBlogPage(authorized: bool, session,
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
blogCSS = cssFile.read()
|
blogCSS = cssFile.read()
|
||||||
blogStr = htmlHeader(cssFilename, blogCSS)
|
blogStr = htmlHeader(cssFilename, blogCSS)
|
||||||
|
htmlBlogRemoveCwButton(blogStr, translate)
|
||||||
|
|
||||||
blogsIndex = baseDir + '/accounts/' + \
|
blogsIndex = baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + '/tlblogs.index'
|
nickname + '@' + domain + '/tlblogs.index'
|
||||||
|
|
Loading…
Reference in New Issue