mirror of https://gitlab.com/bashrc2/epicyon
Function to get post footer with icons
parent
63575327cf
commit
42a3661d9e
|
@ -1070,6 +1070,33 @@ def getPostTitleHtml(baseDir: str,
|
||||||
containerClass)
|
containerClass)
|
||||||
|
|
||||||
|
|
||||||
|
def getFooterWithIcons(showIcons: bool,
|
||||||
|
containerClassIcons: str,
|
||||||
|
replyStr: str, announceStr: str,
|
||||||
|
likeStr: str, bookmarkStr: str,
|
||||||
|
deleteStr: str, muteStr: str, editStr: str,
|
||||||
|
postJsonObject: {}, publishedLink: str,
|
||||||
|
timeClass: str, publishedStr: str) -> str:
|
||||||
|
"""Returns the html for a post footer containing icons
|
||||||
|
"""
|
||||||
|
if not showIcons:
|
||||||
|
return None
|
||||||
|
|
||||||
|
footerStr = '\n <div class="' + containerClassIcons + '">\n'
|
||||||
|
footerStr += replyStr + announceStr + likeStr + bookmarkStr + \
|
||||||
|
deleteStr + muteStr + editStr
|
||||||
|
if not isNewsPost(postJsonObject):
|
||||||
|
footerStr += ' <a href="' + publishedLink + '" class="' + \
|
||||||
|
timeClass + '">' + publishedStr + '</a>\n'
|
||||||
|
else:
|
||||||
|
footerStr += ' <a href="' + \
|
||||||
|
publishedLink.replace('/news/', '/news/statuses/') + \
|
||||||
|
'" class="' + \
|
||||||
|
timeClass + '">' + publishedStr + '</a>\n'
|
||||||
|
footerStr += ' </div>\n'
|
||||||
|
return footerStr
|
||||||
|
|
||||||
|
|
||||||
def individualPostAsHtml(allowDownloads: bool,
|
def individualPostAsHtml(allowDownloads: bool,
|
||||||
recentPostsCache: {}, maxRecentPosts: int,
|
recentPostsCache: {}, maxRecentPosts: int,
|
||||||
iconsPath: str, translate: {},
|
iconsPath: str, translate: {},
|
||||||
|
@ -1447,20 +1474,15 @@ def individualPostAsHtml(allowDownloads: bool,
|
||||||
containerClassIcons = 'containericons dm'
|
containerClassIcons = 'containericons dm'
|
||||||
containerClass = 'container dm'
|
containerClass = 'container dm'
|
||||||
|
|
||||||
# add icons to the bottom of the post
|
newFooterStr = getFooterWithIcons(showIcons,
|
||||||
if showIcons:
|
containerClassIcons,
|
||||||
footerStr = '\n <div class="' + containerClassIcons + '">\n'
|
replyStr, announceStr,
|
||||||
footerStr += replyStr + announceStr + likeStr + bookmarkStr + \
|
likeStr, bookmarkStr,
|
||||||
deleteStr + muteStr + editStr
|
deleteStr, muteStr, editStr,
|
||||||
if not isNewsPost(postJsonObject):
|
postJsonObject, publishedLink,
|
||||||
footerStr += ' <a href="' + publishedLink + '" class="' + \
|
timeClass, publishedStr)
|
||||||
timeClass + '">' + publishedStr + '</a>\n'
|
if newFooterStr:
|
||||||
else:
|
footerStr = newFooterStr
|
||||||
footerStr += ' <a href="' + \
|
|
||||||
publishedLink.replace('/news/', '/news/statuses/') + \
|
|
||||||
'" class="' + \
|
|
||||||
timeClass + '">' + publishedStr + '</a>\n'
|
|
||||||
footerStr += ' </div>\n'
|
|
||||||
|
|
||||||
postIsSensitive = False
|
postIsSensitive = False
|
||||||
if postJsonObject['object'].get('sensitive'):
|
if postJsonObject['object'].get('sensitive'):
|
||||||
|
|
Loading…
Reference in New Issue