Merge pull request #503 from LainLayer/tweet_stats_tweak
Tweet stats tweak
This commit is contained in:
commit
d67ff2f330
|
@ -174,7 +174,8 @@
|
|||
|
||||
.tweet-stat {
|
||||
padding-top: 5px;
|
||||
padding-right: 8px;
|
||||
min-width: 1em;
|
||||
margin-right: 0.8em;
|
||||
}
|
||||
|
||||
.show-thread {
|
||||
|
|
|
@ -45,7 +45,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
|
|||
let opensearchUrl = getUrlPrefix(cfg) & "/opensearch"
|
||||
|
||||
buildHtml(head):
|
||||
link(rel="stylesheet", type="text/css", href="/css/style.css?v=7")
|
||||
link(rel="stylesheet", type="text/css", href="/css/style.css?v=8")
|
||||
link(rel="stylesheet", type="text/css", href="/css/fontello.css?v=2")
|
||||
|
||||
if theme.len > 0:
|
||||
|
|
|
@ -181,12 +181,16 @@ proc renderCard(card: Card; prefs: Prefs; path: string): VNode =
|
|||
tdiv(class="card-content-container"):
|
||||
renderCardContent(card)
|
||||
|
||||
func formatStat(stat: int): string =
|
||||
if stat > 0: insertSep($stat, ',')
|
||||
else: ""
|
||||
|
||||
proc renderStats(stats: TweetStats; views: string): VNode =
|
||||
buildHtml(tdiv(class="tweet-stats")):
|
||||
span(class="tweet-stat"): icon "comment", insertSep($stats.replies, ',')
|
||||
span(class="tweet-stat"): icon "retweet", insertSep($stats.retweets, ',')
|
||||
span(class="tweet-stat"): icon "quote", insertSep($stats.quotes, ',')
|
||||
span(class="tweet-stat"): icon "heart", insertSep($stats.likes, ',')
|
||||
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
||||
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
||||
span(class="tweet-stat"): icon "quote", formatStat(stats.quotes)
|
||||
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
|
||||
if views.len > 0:
|
||||
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
||||
|
||||
|
|
Loading…
Reference in New Issue