Support media tags

This commit is contained in:
Zed
2019-12-21 05:07:50 +01:00
parent 80acfbc40d
commit 80d6191e74
11 changed files with 52 additions and 14 deletions

View File

@@ -195,6 +195,15 @@ proc renderAttribution(profile: Profile): VNode =
img(class="avatar", width="20", height="20", src=avatarUrl)
strong: text profile.fullname
proc renderMediaTags(tags: seq[Profile]): VNode =
buildHtml(tdiv(class="media-tag-block")):
icon "user"
for i, p in tags:
a(class="media-tag", href=("/" & p.username), title=p.username):
text p.fullname
if i < tags.high:
text ", "
proc renderQuoteMedia(quote: Quote): VNode =
buildHtml(tdiv(class="quote-media-container")):
if quote.thumb.len > 0:
@@ -286,6 +295,9 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class="";
if mainTweet:
p(class="tweet-published"): text getTweetTime(tweet)
if tweet.mediaTags.len > 0:
renderMediaTags(tweet.mediaTags)
if not prefs.hideTweetStats:
renderStats(tweet.stats, views)