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