package main import "io" import "strconv" import "html/template" func init() { template_topic_handle = template_topic } func template_topic(tmpl_topic_vars TopicPage, w io.Writer) { 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(`
` + tmpl_topic_vars.Topic.Title + ` ` + tmpl_topic_vars.Topic.Status + ` Status `)) if tmpl_topic_vars.CurrentUser.Is_Mod { w.Write([]byte(` Edit Delete `)) if tmpl_topic_vars.Topic.Sticky { w.Write([]byte(`Unpin`)) } else { w.Write([]byte(`Pin`)) } w.Write([]byte(` `)) } w.Write([]byte(` Report

` + string(tmpl_topic_vars.Topic.Content.(template.HTML)) + `



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

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

` + string(item.ContentHtml) + `



` + item.CreatedByName + ` `)) if tmpl_topic_vars.CurrentUser.Perms.EditReply { w.Write([]byte(``)) } w.Write([]byte(` `)) if tmpl_topic_vars.CurrentUser.Perms.DeleteReply { w.Write([]byte(``)) } w.Write([]byte(` `)) if item.Tag != "" { w.Write([]byte(`` + item.Tag + ``)) } else { if item.URLName != "" { w.Write([]byte(`` + item.URLName + ` ` + item.URLPrefix + ``)) } } w.Write([]byte(`
`)) } } w.Write([]byte(`
`)) if tmpl_topic_vars.CurrentUser.Perms.CreateReply { w.Write([]byte(`
`)) } w.Write([]byte(`
`)) }