Display content attribution

This commit is contained in:
Zed
2019-10-26 16:37:58 +02:00
parent a01265fa48
commit 0b5c15ce67
4 changed files with 35 additions and 1 deletions

View File

@@ -188,6 +188,11 @@ proc renderReply(quote: Quote): VNode =
if i > 0: text " "
a(href=("/" & u)): text "@" & u
proc renderAttribution(profile: Profile): VNode =
buildHtml(a(class="attribution", href=("/" & profile.username))):
img(class="avatar", width="20", height="20", src=profile.getUserpic("_200x200"))
strong: text profile.fullname
proc renderQuoteMedia(quote: Quote): VNode =
buildHtml(tdiv(class="quote-media-container")):
if quote.thumb.len > 0:
@@ -258,6 +263,9 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class="";
tdiv(class="tweet-content media-body", dir="auto"):
verbatim replaceUrl(tweet.text, prefs)
if tweet.attribution.isSome:
renderAttribution(tweet.attribution.get())
if tweet.quote.isSome:
renderQuote(tweet.quote.get(), prefs)