{{define "postActions"}}
{{if canReply .User .Root}}
Reply
{{end}} {{if canEditPost .User .Post}}
Edit
{{end}} Permalink {{if and (not .Post.ParentID) (isAdmin .User)}}
{{end}}
{{end}} {{define "threadReply"}} {{$ctx := .}}

{{postLabel .Post}}

{{.Post.Body}}

{{template "postActions" .}} {{if .Post.Replies}}
{{range .Post.Replies}} {{template "threadReply" (postCtx $ctx.User $ctx.CSRF $ctx.Root . (add $ctx.Depth 1))}} {{end}}
{{end}}
{{end}}