added favoriters and retweeters links to tweet-stats
This commit is contained in:
parent
e4eea3d2df
commit
ba9a4714e2
2 changed files with 14 additions and 8 deletions
|
@ -207,6 +207,7 @@
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
min-width: 1em;
|
min-width: 1em;
|
||||||
margin-right: 0.8em;
|
margin-right: 0.8em;
|
||||||
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show-thread {
|
.show-thread {
|
||||||
|
|
|
@ -181,12 +181,17 @@ func formatStat(stat: int): string =
|
||||||
if stat > 0: insertSep($stat, ',')
|
if stat > 0: insertSep($stat, ',')
|
||||||
else: ""
|
else: ""
|
||||||
|
|
||||||
proc renderStats(stats: TweetStats; views: string): VNode =
|
proc renderStats(stats: TweetStats; views: string; tweet: Tweet): VNode =
|
||||||
buildHtml(tdiv(class="tweet-stats")):
|
buildHtml(tdiv(class="tweet-stats")):
|
||||||
|
a(href=getLink(tweet)):
|
||||||
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
||||||
|
a(href=getLink(tweet, false) & "/retweeters"):
|
||||||
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
||||||
|
a(href=getLink(tweet)):
|
||||||
span(class="tweet-stat"): icon "quote", formatStat(stats.quotes)
|
span(class="tweet-stat"): icon "quote", formatStat(stats.quotes)
|
||||||
|
a(href=getLink(tweet, false) & "/favoriters"):
|
||||||
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
|
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
|
||||||
|
a(href=getLink(tweet)):
|
||||||
if views.len > 0:
|
if views.len > 0:
|
||||||
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
||||||
|
|
||||||
|
@ -344,7 +349,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
||||||
renderMediaTags(tweet.mediaTags)
|
renderMediaTags(tweet.mediaTags)
|
||||||
|
|
||||||
if not prefs.hideTweetStats:
|
if not prefs.hideTweetStats:
|
||||||
renderStats(tweet.stats, views)
|
renderStats(tweet.stats, views, tweet)
|
||||||
|
|
||||||
if showThread:
|
if showThread:
|
||||||
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
||||||
|
|
Loading…
Reference in a new issue