From 55987a4c1bd7364eba7438e7326a76a9a550b668 Mon Sep 17 00:00:00 2001 From: r Date: Tue, 14 Jan 2020 16:57:16 +0000 Subject: Refactor renderer and templates --- templates/thread.tmpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'templates/thread.tmpl') diff --git a/templates/thread.tmpl b/templates/thread.tmpl index 7ec0e94..2927ee4 100644 --- a/templates/thread.tmpl +++ b/templates/thread.tmpl @@ -1,14 +1,16 @@ -{{template "header.tmpl" .HeaderData}} -{{template "navigation.tmpl" .NavbarData}} +{{with $s := .Data}} +{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} +{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
Thread
{{range .Statuses}} -{{template "status.tmpl" .}} -{{if $.PostContext.ReplyContext}}{{if eq .ID $.PostContext.ReplyContext.InReplyToID}} -{{template "postform.tmpl" $.PostContext}} +{{template "status.tmpl" (WithContext . $.Ctx)}} +{{if $s.PostContext.ReplyContext}}{{if eq .ID $s.PostContext.ReplyContext.InReplyToID}} +{{template "postform.tmpl" (WithContext $s.PostContext $.Ctx)}} {{end}}{{end}} {{end}} {{template "footer.tmpl"}} +{{end}} -- cgit v1.2.3