{{ define "thread/post" }}
{{ if .Thread }}
{{ else }} {{ end }} {{ if .PreviousError }} {{ end }} {{ if ne .Config.Captcha.Mode "disabled" }} {{ end }} {{ if (isModSession .Session) }} {{ end }} {{ if .Board.Metadata.rules }} {{ end }}
Error {{.PreviousError}}
TripCode
Comment
Image File
Captcha {{ $captchaId := makeCaptcha }} Captcha Image
Mod Post {{ if (isAdminSession .Session) }} {{ end }}
Rules {{ renderText .Board.Metadata.rules }}

{{ end }} {{ define "thread/reply" }} {{dateFromID .Reply.ID | formatDate}} {{ if .Session }} {{ if eq (.Session.CAttr "mode") "admin" }}
{{ end }} {{ end }} {{ if not .Reply.Metadata.spamscore }} {{ $score := (rateSpam .Reply.Text) }} {{printf "[SpamScore: %f]" $score }} {{printf "[Captcha: %.3f%%]" (percentFloat (captchaProb $score)) }} {{printf "[OLD]"}} {{ else }} {{ printf "[SpamScore: %s]" .Reply.Metadata.spamscore }} {{ printf "[Captcha: %s %%]" .Reply.Metadata.captchaprob }} {{ end }} No.{{.Reply.ID}} {{ if .Reply.Thumbnail }}
{{ end }} {{ if .Reply.Metadata.deleted }}
{{ renderText .Reply.Text }}
{{ else }}
{{ renderText .Reply.Text}}
{{ end }} {{ end }} {{ define "thread/main" }}
{{ $boardlink := .Board.ShortName }} {{ $threadrid := .Thread.GetReply.ID }} {{ $threadid := .Thread.ID }} {{ $csrf := .CSRFToken }} {{ $session := .Session }} {{ with .Thread }} {{ with .GetReply }} {{ with dict "Reply" . "Boardlink" $boardlink "CSRF" $csrf "ThreadID" $threadid "Session" $session }} {{ template "thread/reply" . }} {{ end }} {{ end }} {{range .GetReplies}} {{ if ne .ID $threadrid }}
>> {{ with dict "Reply" . "Boardlink" $boardlink "CSRF" $csrf "ThreadID" $threadid "Session" $session }} {{ template "thread/reply" . }} {{ end }}
{{end}} {{end}} {{end}}

{{ end }} {{ template "thread/main" . }}