From 5f198a35db2b046550a0f47178cc006a1feb7a34 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Thu, 24 May 2018 14:46:59 +0100 Subject: [PATCH] Show usernames of people that liked a post on hover. --- src/frontend/postbutton.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/postbutton.nim b/src/frontend/postbutton.nim index 673bf62..b76f6a0 100644 --- a/src/frontend/postbutton.nim +++ b/src/frontend/postbutton.nim @@ -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"))