package main import "io" import "strconv" import "html/template" func init() { ctemplates["topic"] = template_topic } func template_topic(tmpl_topic_vars Page, w io.Writer) { var extra_data TopicUser = tmpl_topic_vars.Something.(TopicUser) w.Write([]byte(` ` + tmpl_topic_vars.Title + `
`)) if len(tmpl_topic_vars.NoticeList) != 0 { for _, item := range tmpl_topic_vars.NoticeList { w.Write([]byte(`
` + item + `
`)) } } w.Write([]byte(`
` + extra_data.Title + ` ` + extra_data.Status + ` Status `)) if tmpl_topic_vars.CurrentUser.Is_Mod { w.Write([]byte(` Edit Delete `)) if extra_data.Sticky { w.Write([]byte(`Unpin`)) } else { w.Write([]byte(`Pin`)) } w.Write([]byte(` `)) } w.Write([]byte(` Report
` + string(extra_data.Content.(template.HTML)) + `

` + extra_data.CreatedByName + ` `)) if extra_data.Tag != "" { w.Write([]byte(`` + extra_data.Tag + ``)) } else { if extra_data.URLName != "" { w.Write([]byte(`` + extra_data.URLName + ` ` + extra_data.URLPrefix + ``)) } } w.Write([]byte(`

`)) if len(tmpl_topic_vars.ItemList) != 0 { for _, item := range tmpl_topic_vars.ItemList { w.Write([]byte(`
` + string(item.(Reply).ContentHtml) + `

` + item.(Reply).CreatedByName + ` `)) if tmpl_topic_vars.CurrentUser.Is_Mod { w.Write([]byte(` `)) } w.Write([]byte(` `)) if item.(Reply).Tag != "" { w.Write([]byte(`` + item.(Reply).Tag + ``)) } else { if item.(Reply).URLName != "" { w.Write([]byte(`` + item.(Reply).URLName + ` ` + item.(Reply).URLPrefix + ``)) } } w.Write([]byte(`
`)) } } w.Write([]byte(`
`)) if !tmpl_topic_vars.CurrentUser.Is_Banned && tmpl_topic_vars.CurrentUser.Loggedin { w.Write([]byte(`
`)) } w.Write([]byte(`
`)) }