feat: minor css and nim layout changes
This commit is contained in:
@@ -178,7 +178,7 @@ func formatStat(stat: int): string =
|
||||
if stat > 0: insertSep($stat, ',')
|
||||
else: ""
|
||||
|
||||
proc renderStats(tweet_id: int64; stats: TweetStats; views: string): VNode =
|
||||
proc renderStats(tweet_id: int64; stats: TweetStats; views: string; published: string): VNode =
|
||||
buildHtml(tdiv(class="tweet-stats")):
|
||||
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
||||
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
||||
@@ -188,6 +188,8 @@ proc renderStats(tweet_id: int64; stats: TweetStats; views: string): VNode =
|
||||
span(class="tweet-stat"): icon "views", formatStat(stats.views)
|
||||
if views.len > 0:
|
||||
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
||||
if published.len > 0:
|
||||
span(class="tweet-published"): text published
|
||||
|
||||
proc renderReply(tweet: Tweet): VNode =
|
||||
buildHtml(tdiv(class="replying-to")):
|
||||
@@ -338,14 +340,13 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
||||
if tweet.quote.isSome:
|
||||
renderQuote(tweet.quote.get(), prefs, path)
|
||||
|
||||
if mainTweet:
|
||||
p(class="tweet-published"): text &"{getTime(tweet)}"
|
||||
let published = if mainTweet: getTime(tweet) else: ""
|
||||
|
||||
if tweet.mediaTags.len > 0:
|
||||
renderMediaTags(tweet.mediaTags)
|
||||
|
||||
if not prefs.hideTweetStats:
|
||||
renderStats(tweet.id, tweet.stats, views)
|
||||
renderStats(tweet.id, tweet.stats, views, published)
|
||||
|
||||
if showThread:
|
||||
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
||||
|
||||
Reference in New Issue
Block a user