{{template "header.html" . }}
{{if gt .Page 1}}
{{end}} {{if ne .LastPage .Page}}
{{end}}

{{.Topic.Title}}

{{if .Topic.IsClosed}}🔒︎{{end}} {{/** TODO: Does this need to be guarded by a permission? It's only visible in edit mode anyway, which can't be triggered, if they don't have the permission **/}} {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}} {{if .CurrentUser.Perms.EditTopic}} {{end}} {{end}}
{{if .Poll.ID}}
{{range .Poll.QuickOptions}}
{{.Value}}
{{end}}
{{end}}

{{.Topic.ContentHTML}}

   {{if .CurrentUser.Perms.LikeItem}} {{end}} {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}} {{if .CurrentUser.Perms.EditTopic}}{{end}} {{end}} {{if .CurrentUser.Perms.DeleteTopic}}{{end}} {{if .CurrentUser.Perms.CloseTopic}}{{if .Topic.IsClosed}}{{else}}{{end}}{{end}} {{if .CurrentUser.Perms.PinTopic}}{{if .Topic.Sticky}}{{else}}{{end}}{{end}} {{if .CurrentUser.Perms.ViewIPs}}{{end}} {{if .Topic.Tag}}{{.Topic.Tag}}{{else}}{{.Topic.Level}}{{end}}
{{range .ItemList}}{{if .ActionType}}
{{.ActionIcon}} {{.ActionType}}
{{else}}
{{/** TODO: We might end up with
s in the inline editor, fix this **/}}

{{.ContentHtml}}

   {{if $.CurrentUser.Perms.LikeItem}}{{if .Liked}}{{else}}{{end}}{{end}} {{if not $.Topic.IsClosed or $.CurrentUser.Perms.CloseTopic}} {{if $.CurrentUser.Perms.EditReply}}{{end}} {{end}} {{if $.CurrentUser.Perms.DeleteReply}}{{end}} {{if $.CurrentUser.Perms.ViewIPs}}{{end}} {{if .Tag}}{{.Tag}}{{else}}{{.Level}}{{end}}
{{end}}{{end}}
{{if .CurrentUser.Perms.CreateReply}} {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}}
{{if .CurrentUser.Perms.UploadFiles}}
{{end}}
{{end}} {{end}}
{{template "footer.html" . }}