unified function call styles
This commit is contained in:
parent
aee222eb62
commit
eff098003f
|
@ -14,7 +14,7 @@ proc createEmbedRouter*(cfg: Config) =
|
||||||
if convo == nil or convo.tweet == nil or convo.tweet.video.isNone:
|
if convo == nil or convo.tweet == nil or convo.tweet.video.isNone:
|
||||||
resp Http404
|
resp Http404
|
||||||
|
|
||||||
resp renderVideoEmbed(cfg, request, convo.tweet)
|
resp renderVideoEmbed(convo.tweet, cfg, request)
|
||||||
|
|
||||||
get "/@user/status/@id/embed":
|
get "/@user/status/@id/embed":
|
||||||
let
|
let
|
||||||
|
@ -25,7 +25,7 @@ proc createEmbedRouter*(cfg: Config) =
|
||||||
if convo == nil or convo.tweet == nil:
|
if convo == nil or convo.tweet == nil:
|
||||||
resp Http404
|
resp Http404
|
||||||
|
|
||||||
resp $renderTweetEmbed(convo.tweet, prefs, path, cfg, request)
|
resp $renderTweetEmbed(convo.tweet, path, prefs, cfg, request)
|
||||||
|
|
||||||
get "/embed/Tweet.html":
|
get "/embed/Tweet.html":
|
||||||
let id = @"id"
|
let id = @"id"
|
||||||
|
|
|
@ -8,7 +8,7 @@ import general, tweet
|
||||||
|
|
||||||
const doctype = "<!DOCTYPE html>\n"
|
const doctype = "<!DOCTYPE html>\n"
|
||||||
|
|
||||||
proc renderVideoEmbed*(cfg: Config; req: Request; tweet: Tweet): string =
|
proc renderVideoEmbed*(tweet: Tweet; cfg: Config; req: Request): string =
|
||||||
let thumb = get(tweet.video).thumb
|
let thumb = get(tweet.video).thumb
|
||||||
let vidUrl = getVideoEmbed(cfg, tweet.id)
|
let vidUrl = getVideoEmbed(cfg, tweet.id)
|
||||||
let prefs = Prefs(hlsPlayback: true)
|
let prefs = Prefs(hlsPlayback: true)
|
||||||
|
|
|
@ -356,7 +356,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
||||||
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
||||||
text "Show this thread"
|
text "Show this thread"
|
||||||
|
|
||||||
proc renderTweetEmbed*(tweet: Tweet; prefs: Prefs; path: string; cfg: Config; req: Request): VNode =
|
proc renderTweetEmbed*(tweet: Tweet; path: string; prefs: Prefs; cfg: Config; req: Request): VNode =
|
||||||
buildHtml(tdiv(class="tweet-embed")):
|
buildHtml(tdiv(class="tweet-embed")):
|
||||||
renderHead(prefs, cfg, req)
|
renderHead(prefs, cfg, req)
|
||||||
renderTweet(tweet, prefs, path, mainTweet=true)
|
renderTweet(tweet, prefs, path, mainTweet=true)
|
||||||
|
|
Loading…
Reference in New Issue