Moderation reports don't have like or announce

master
Bob Mottram 2019-08-12 14:47:17 +01:00
parent cc81de178f
commit a078f1c394
1 changed files with 30 additions and 22 deletions

View File

@ -790,6 +790,9 @@ def individualPostAsHtml(baseDir: str, \
return ''
if not isinstance(postJsonObject['object'], dict):
return ''
isModerationPost=False
if postJsonObject['object'].get('moderationStatus'):
isModerationPost=True
avatarPosition=''
containerClass='container'
containerClassIcons='containericons'
@ -890,6 +893,8 @@ def individualPostAsHtml(baseDir: str, \
publishedStr=datetimeObject.strftime("%a %b %d, %H:%M")
footerStr='<span class="'+timeClass+'">'+publishedStr+'</span>\n'
announceStr=''
if not isModerationPost:
# don't allow announce/repeat of your own posts
announceIcon='repeat_inactive.png'
announceLink='repeat'
@ -902,6 +907,8 @@ def individualPostAsHtml(baseDir: str, \
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+'" title="'+announceTitle+'">' \
'<img src="/icons/'+announceIcon+'"/></a>'
likeStr=''
if not isModerationPost:
likeIcon='like_inactive.png'
likeLink='like'
likeTitle='Like this post'
@ -912,6 +919,7 @@ def individualPostAsHtml(baseDir: str, \
likeStr= \
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+'" title="'+likeTitle+'">' \
'<img src="/icons/'+likeIcon+'"/></a>'
deleteStr=''
if allowDeletion:
if '/users/'+nickname+'/' in postJsonObject['object']['id']:
@ -946,7 +954,7 @@ def individualPostAsHtml(baseDir: str, \
contentStr=''
if postJsonObject['object'].get('summary'):
contentStr+='<b>'+postJsonObject['object']['summary']+'</b> '
if postJsonObject['object'].get('moderationStatus'):
if isModerationPost:
containerClass='container report'
else:
contentStr+='<b>Sensitive</b> '