{{if gt .Page 1}}
{{end}} {{if ne .LastPage .Page}}
{{end}} {{if not .CurrentUser.Loggedin}}{{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}}{{template "topic_poll.html" . }}{{end}}
{{.Topic.ContentHTML}}
{{if .CurrentUser.Loggedin}}{{end}}    {{if .CurrentUser.Loggedin}} {{if .CurrentUser.Perms.LikeItem}}{{if ne .CurrentUser.ID .Topic.CreatedBy}} {{if .Topic.Liked}} {{else}} {{end}} {{end}}{{end}} {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}} {{if .CurrentUser.Perms.EditTopic}}{{end}} {{end}} {{if .Topic.Deletable}}{{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}} {{end}} {{if .Topic.Tag}}{{.Topic.Tag}}{{else}}{{level .Topic.Level}}{{end}}
{{template "topic_posts.html" . }} {{if .CurrentUser.Perms.CreateReply}} {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}}
{{if .CurrentUser.Perms.UploadFiles}}
{{end}}
{{end}} {{end}}