Support quoted replies stat, update font

This commit is contained in:
Zed
2020-11-08 01:32:17 +01:00
parent 82fe5d8b78
commit b6a49fc4cb
13 changed files with 53 additions and 40 deletions

View File

@@ -230,6 +230,7 @@ proc parseTweet(js: JsonNode): Tweet =
replies: js{"reply_count"}.getInt,
retweets: js{"retweet_count"}.getInt,
likes: js{"favorite_count"}.getInt,
quotes: js{"quote_count"}.getInt
)
)

View File

@@ -10,6 +10,7 @@ nav {
width: 100%;
height: 50px;
z-index: 1000;
font-size: 16px;
a, .icon-button button {
color: var(--fg_nav);
@@ -67,7 +68,8 @@ nav {
}
.lp {
height: 13px;
height: 14px;
margin-top: 2px;
display: block;
fill: var(--fg_nav);
@@ -75,3 +77,11 @@ nav {
fill: var(--accent_light);
}
}
.icon-info:before {
margin: 0 -3px;
}
.icon-cog {
font-size: 15px;
}

View File

@@ -140,6 +140,7 @@ type
replies*: int
retweets*: int
likes*: int
quotes*: int
Tweet* = ref object
id*: int64

View File

@@ -28,7 +28,7 @@ proc renderNavbar*(title, rss: string; req: Request): VNode =
icon "rss-feed", title="RSS Feed", href=rss
icon "bird", title="Open in Twitter", href=twitterPath
a(href="https://liberapay.com/zedeus"): verbatim lp
icon "info-circled", title="About", href="/about"
icon "info", title="About", href="/about"
iconReferer "cog", "/settings", path, title="Preferences"
proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";

View File

@@ -27,7 +27,7 @@ proc linkUser*(profile: Profile, class=""): VNode =
icon "ok", class="verified-icon", title="Verified account"
if isName and profile.protected:
text " "
icon "lock-circled", title="Protected account"
icon "lock", title="Protected account"
proc linkText*(text: string; class=""): VNode =
let url = if "http" notin text: "http://" & text else: text

View File

@@ -186,6 +186,7 @@ proc renderStats(stats: TweetStats; views: string): VNode =
span(class="tweet-stat"): icon "comment", insertSep($stats.replies, ',')
span(class="tweet-stat"): icon "retweet", insertSep($stats.retweets, ',')
span(class="tweet-stat"): icon "heart", insertSep($stats.likes, ',')
span(class="tweet-stat"): icon "quote", insertSep($stats.quotes, ',')
if views.len > 0:
span(class="tweet-stat"): icon "play", insertSep(views, ',')