Check if a post was liked by the viewer

main2
Bob Mottram 2019-09-11 17:16:28 +01:00
parent a4e8282028
commit 3ae0f98f7c
1 changed files with 3 additions and 2 deletions

View File

@ -1765,8 +1765,9 @@ def individualPostAsHtml(translate: {}, \
likeTitle=translate['Like this post']
if noOfLikes(postJsonObject)>0:
likeIcon='like.png'
likeLink='unlike'
likeTitle=translate['Undo the like']
if likedByPerson(postJsonObject,nickname,fullDomain):
likeLink='unlike'
likeTitle=translate['Undo the like']
likeStr= \
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+likeTitle+'">' \
'<img src="/icons/'+likeIcon+'"/></a>'