Show usernames of people that liked a post on hover.
This commit is contained in:
parent
2e3f8d4235
commit
5f198a35db
1 changed files with 3 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
##
|
##
|
||||||
## Used for password reset emails.
|
## Used for password reset emails.
|
||||||
|
|
||||||
import options, httpcore, json, sugar
|
import options, httpcore, json, sugar, sequtils, strutils
|
||||||
when defined(js):
|
when defined(js):
|
||||||
include karax/prelude
|
include karax/prelude
|
||||||
import karax/[kajax, kdom]
|
import karax/[kajax, kdom]
|
||||||
|
|
@ -139,7 +139,8 @@ when defined(js):
|
||||||
onmouseleave=(e: Event, n: VNode) =>
|
onmouseleave=(e: Event, n: VNode) =>
|
||||||
(state.error = none[PostError]())):
|
(state.error = none[PostError]())):
|
||||||
if post.likes.len > 0:
|
if post.likes.len > 0:
|
||||||
span(class="like-count"):
|
let names = post.likes.map(x => x.name).join(", ")
|
||||||
|
span(class="like-count tooltip", "data-tooltip"=names):
|
||||||
text $post.likes.len
|
text $post.likes.len
|
||||||
|
|
||||||
italic(class=class({"far": not liked, "fas": liked}, "fa-heart"))
|
italic(class=class({"far": not liked, "fas": liked}, "fa-heart"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue