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,6 +893,8 @@ 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'
announceStr=''
if not isModerationPost:
# don't allow announce/repeat of your own posts # don't allow announce/repeat of your own posts
announceIcon='repeat_inactive.png' announceIcon='repeat_inactive.png'
announceLink='repeat' announceLink='repeat'
@ -902,6 +907,8 @@ def individualPostAsHtml(baseDir: str, \
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+'" title="'+announceTitle+'">' \ '<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+'" title="'+announceTitle+'">' \
'<img src="/icons/'+announceIcon+'"/></a>' '<img src="/icons/'+announceIcon+'"/></a>'
likeStr=''
if not isModerationPost:
likeIcon='like_inactive.png' likeIcon='like_inactive.png'
likeLink='like' likeLink='like'
likeTitle='Like this post' likeTitle='Like this post'
@ -912,6 +919,7 @@ def individualPostAsHtml(baseDir: str, \
likeStr= \ likeStr= \
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+'" title="'+likeTitle+'">' \ '<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+'" title="'+likeTitle+'">' \
'<img src="/icons/'+likeIcon+'"/></a>' '<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> '