{{define "postActions"}}
{{if canReply .User .Root}}
Reply
{{template "imagePicker" (newImagePicker (printf "reply-images-%s" .Post.ID))}}
{{end}} {{if canEditPost .User .Post}}
Edit
{{template "imagePicker" (imagePicker (printf "edit-images-%s" .Post.ID) .Post.Images)}}
{{end}} Permalink {{if and (not .Post.ParentID) (isAdmin .User)}}
{{end}}
{{end}} {{define "threadReply"}} {{$ctx := .}}

{{postLabel .Post}}

{{.Post.Body}}

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