From 4763226f70460c01d491491059208a0d67002688 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 5 Sep 2020 12:29:52 +0100 Subject: [PATCH] Show non-reader likes count --- epicyon-profile.css | 6 ++++++ webinterface.py | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/epicyon-profile.css b/epicyon-profile.css index 044c56d71..37b6f5eb0 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -26,6 +26,7 @@ --font-size3: 38px; --font-size4: 22px; --font-size5: 20px; + --font-size-likes: 16px; --font-size-pgp-key: 16px; --font-size-pgp-key2: 8px; --font-size-tox: 16px; @@ -138,6 +139,11 @@ a:focus { float: right; } +.likesCount { + font-size: var(--font-size-likes); + font-family: Arial, Helvetica, sans-serif; +} + .about { font-size: var(--font-size5); font-family: Arial, Helvetica, sans-serif; diff --git a/webinterface.py b/webinterface.py index c8381b031..a2f1cf4c3 100644 --- a/webinterface.py +++ b/webinterface.py @@ -4214,12 +4214,14 @@ def individualPostAsHtml(allowDownloads: bool, likeCountStr = '' if likeCount > 0: - if likeCount > 1: - if likeCount <= 10: - likeCountStr = ' (' + str(likeCount) + ')' - else: - likeCountStr = ' (10+)' + if likeCount <= 10: + likeCountStr = ' (' + str(likeCount) + ')' + else: + likeCountStr = ' (10+)' if likedByPerson(postJsonObject, nickname, fullDomain): + if likeCount == 1: + # liked by the reader only + likeCountStr = '' likeIcon = 'like.png' likeLink = 'unlike' likeTitle = translate['Undo the like'] @@ -4241,7 +4243,13 @@ def individualPostAsHtml(allowDownloads: bool, likeStr += \ '' + likeTitle + \
-            ' |\n' + ' |" src="/' + iconsDir + '/' + likeIcon + '"/>' + if likeCountStr: + # show the number of likes next to icon + likeStr += '' + likeStr += '\n' # benchmark 12.5 if not allowDownloads: