Improve verified badges

This commit is contained in:
Zed
2019-06-20 17:57:31 +02:00
parent a9826151e9
commit 22e98edf4e
3 changed files with 19 additions and 6 deletions

View File

@@ -69,13 +69,12 @@ proc getGifSrc*(tweet: Tweet): string =
proc getGifThumb*(tweet: Tweet): string =
fmt"https://pbs.twimg.com/tweet_video_thumb/{tweet.gif}.jpg"
proc formatName(profile: Profile): string =
result = profile.fullname
proc formatName*(profile: Profile): string =
result = xmltree.escape(profile.fullname)
if profile.verified:
result &= " 🔹"
result &= htmlgen.span("", class="verified-icon")
elif profile.protected:
result &= " 🔒"
result = xmltree.escape(result)
proc linkUser*(profile: Profile; h: string; username=true; class=""): string =
let text =