forked from indymedia/epicyon
Separate function for content warning button
parent
20a24edaa8
commit
6084fbcce9
|
@ -73,6 +73,16 @@ from git import isGitPatch
|
||||||
from theme import getThemesList
|
from theme import getThemesList
|
||||||
|
|
||||||
|
|
||||||
|
def getContentWarningButton(postID: str, translate: {},
|
||||||
|
content: str) -> str:
|
||||||
|
"""Returns the markup for a content warning button
|
||||||
|
"""
|
||||||
|
return '<button class="cwButton" onclick="showContentWarning(' + \
|
||||||
|
"'" + postID + "'" + ')">' + translate['SHOW MORE'] + '</button>' + \
|
||||||
|
'<div class="cwText" id="' + postID + '">' + \
|
||||||
|
content + '</div>'
|
||||||
|
|
||||||
|
|
||||||
def getBlogAddress(actorJson: {}) -> str:
|
def getBlogAddress(actorJson: {}) -> str:
|
||||||
"""Returns blog address for the given actor
|
"""Returns blog address for the given actor
|
||||||
"""
|
"""
|
||||||
|
@ -4095,17 +4105,15 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
'<b>' + postJsonObject['object']['summary'] + '</b> '
|
'<b>' + postJsonObject['object']['summary'] + '</b> '
|
||||||
if isModerationPost:
|
if isModerationPost:
|
||||||
containerClass = 'container report'
|
containerClass = 'container report'
|
||||||
contentStr += \
|
# get the content warning text
|
||||||
'<button class="cwButton" onclick="showContentWarning(' + \
|
cwContentStr = objectContent + attachmentStr
|
||||||
"'" + postID + "'" + ')">' + translate['SHOW MORE'] + '</button>'
|
|
||||||
contentStr += '<div class="cwText" id="' + postID + '">'
|
|
||||||
contentStr += objectContent + attachmentStr
|
|
||||||
if not isPatch:
|
if not isPatch:
|
||||||
contentStr = addEmbeddedElements(translate, contentStr)
|
cwContentStr = addEmbeddedElements(translate, cwContentStr)
|
||||||
contentStr = \
|
cwContentStr = \
|
||||||
insertQuestion(baseDir, translate, nickname, domain, port,
|
insertQuestion(baseDir, translate, nickname, domain, port,
|
||||||
contentStr, postJsonObject, pageNumber)
|
cwContentStr, postJsonObject, pageNumber)
|
||||||
contentStr += '</div>'
|
# get the content warning button
|
||||||
|
contentStr += getContentWarningButton(postID, translate, cwContentStr)
|
||||||
|
|
||||||
if postJsonObject['object'].get('tag') and not isPatch:
|
if postJsonObject['object'].get('tag') and not isPatch:
|
||||||
contentStr = \
|
contentStr = \
|
||||||
|
|
Loading…
Reference in New Issue