package board import ( "github.com/GeertJohan/go.rice/embedded" "time" ) func init() { // define files file2 := &embedded.EmbeddedFile{ Filename: `board.html`, FileModTime: time.Unix(1489412682, 0), Content: string("\n\n\n \n \n {{.Config.Site.Title}} - /{{.Board.ShortName}}/\n \n \n\n\n
\n

/{{.Board.ShortName}}/

\n

{{.Board.LongName}}

\n
\n{{ $boardlink := .Board.ShortName }}\n{{ if .Session }}\n{{ if eq (.Session.CAttr \"mode\") \"admin\" }}\nLogged in as Admin\n{{ end }}\n{{ if eq (.Session.CAttr \"mode\") \"mod\" }}\nLogged in as Mod for {{ .Session.CAttr \"board\" }}\n{{ end }}\n{{ end }}\n
\n{{ template \"thread/post\" . }}\n
\n {{ $board := .Board }}\n {{ $csrf := .CSRFToken }}\n {{ $session := .Session }}\n {{range .Threads}}\n {{ template \"thread/postlists\" dict \"Thread\" . \"Board\" $board \"CSRFToken\" $csrf \"Session\" $session }}\n {{end}}\n
\n\n"), } file3 := &embedded.EmbeddedFile{ Filename: `dir.html`, FileModTime: time.Unix(1489315156, 0), Content: string("\n\n\n \n \n {{.Config.Site.Title}} Boards\n \n \n\n\n
\n

{{.Config.Site.Title}}

\n

{{.Config.Site.Description}}

\n
\n
\n
\n

Boards

\n
\n
\n \n
\n
\n\n"), } file4 := &embedded.EmbeddedFile{ Filename: `thread.html`, FileModTime: time.Unix(1489412660, 0), Content: string("\n\n\n \n \n {{.Config.Site.Title}} - /{{.Board.ShortName}}/\n \n \n\n\n
\n

/{{.Board.ShortName}}/

\n

{{.Board.LongName}}

\n

{{.Thread.ID}}

\n
\n{{ $boardlink := .Board.ShortName }}\n
\n{{ template \"thread/post\" . }}\n{{ template \"thread/postlists\" . }}\n\n"), } file5 := &embedded.EmbeddedFile{ Filename: `thread.tmpl.html`, FileModTime: time.Unix(1489566591, 0), Content: string("{{ define \"thread/post\" }}\n
\n {{ if .Thread }}\n
\n {{ else }}\n \n {{ end }}\n \n \n {{ if .PreviousError }}\n \n \n \n \n {{ end }}\n \n \n \n \n \n \n \n \n \n \n \n \n {{ if ne .Config.Captcha.Mode \"disabled\" }}\n \n \n \n \n {{ end }}\n {{ if (isModSession .Session) }}\n \n \n \n \n {{ end }}\n \n \n \n \n {{ if .Board.Metadata.rules }}\n \n \n \n \n {{ end }}\n \n
\n Error\n \n {{.PreviousError}}\n
\n TripCode\n \n \n \n
\n Comment\n \n \n
\n Image File\n \n \n
\n Captcha\n \n {{ $captchaId := makeCaptcha }}\n \"Captcha\n \n
\n \n \n
\n Mod Post\n \n \n {{ if (isAdminSession .Session) }}\n \n {{ end }}\n
\n\n \n \n
\n Rules\n \n {{ renderText .Board.Metadata.rules }}\n
\n
\n
\n
\n{{ end }}\n\n{{ define \"thread/reply\" }}\n \n {{dateFromID .Reply.ID | formatDate}}\n {{ if .Session }}\n {{ if eq (.Session.CAttr \"mode\") \"admin\" }}\n
\n \n \n \n \n \n \n {{ end }}\n {{ end }}\n \n {{ if not .Reply.Metadata.spamscore }}\n {{ $score := (rateSpam .Reply.Text) }}\n {{printf \"[SpamScore: %f]\" $score }}\n {{printf \"[Captcha: %.3f%%]\" (percentFloat (captchaProb $score)) }}\n {{printf \"[OLD]\"}}\n {{ else }}\n {{ printf \"[SpamScore: %s]\" .Reply.Metadata.spamscore }}\n {{ printf \"[Captcha: %s %%]\" .Reply.Metadata.captchaprob }}\n {{ end }}\n \n \n No.{{.Reply.ID}}\n \n {{ if .Reply.Thumbnail }}\n
\n \n \n \n {{ end }}\n {{ if .Reply.Metadata.deleted }}\n
\n {{ renderText .Reply.Text }}\n
\n {{ else }}\n
\n {{ renderText .Reply.Text}}\n
\n {{ end }}\n{{ end }}\n\n{{ define \"thread/main\" }}\n
\n {{ $boardlink := .Board.ShortName }}\n {{ $threadrid := .Thread.GetReply.ID }}\n {{ $threadid := .Thread.ID }}\n {{ $csrf := .CSRFToken }}\n {{ $session := .Session }}\n {{ with .Thread }}\n {{ with .GetReply }}\n {{ with dict \"Reply\" . \"Boardlink\" $boardlink \"CSRF\" $csrf \"ThreadID\" $threadid \"Session\" $session }}\n {{ template \"thread/reply\" . }}\n {{ end }}\n {{ end }}\n {{range .GetReplies}}\n {{ if ne .ID $threadrid }}\n \n \n
>>\n {{ with dict \"Reply\" . \"Boardlink\" $boardlink \"CSRF\" $csrf \"ThreadID\" $threadid \"Session\" $session }}\n {{ template \"thread/reply\" . }}\n {{ end }}\n
\n {{end}}\n {{end}}\n {{end}}\n

\n
\n{{ end }}\n\n{{ template \"thread/main\" . }}"), } // define dirs dir1 := &embedded.EmbeddedDir{ Filename: ``, DirModTime: time.Unix(1489566591, 0), ChildFiles: []*embedded.EmbeddedFile{ file2, // board.html file3, // dir.html file4, // thread.html file5, // thread.tmpl.html }, } // link ChildDirs dir1.ChildDirs = []*embedded.EmbeddedDir{} // register embeddedBox embedded.RegisterEmbeddedBox(`res/`, &embedded.EmbeddedBox{ Name: `res/`, Time: time.Unix(1489566591, 0), Dirs: map[string]*embedded.EmbeddedDir{ "": dir1, }, Files: map[string]*embedded.EmbeddedFile{ "board.html": file2, "dir.html": file3, "thread.html": file4, "thread.tmpl.html": file5, }, }) }