Show usernames of people that liked a post on hover.

This commit is contained in:
Dominik Picheta 2018-05-24 14:46:59 +01:00
commit 5f198a35db

View file

@ -3,7 +3,7 @@
##
## Used for password reset emails.
import options, httpcore, json, sugar
import options, httpcore, json, sugar, sequtils, strutils
when defined(js):
include karax/prelude
import karax/[kajax, kdom]
@ -139,7 +139,8 @@ when defined(js):
onmouseleave=(e: Event, n: VNode) =>
(state.error = none[PostError]())):
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
italic(class=class({"far": not liked, "fas": liked}, "fa-heart"))