package main import "strconv" import "io" func init() { ctemplates["forum"] = template_forum } func template_forum(tmpl_forum_vars Page, w io.Writer) { w.Write([]byte(` ` + tmpl_forum_vars.Title + `
`)) if len(tmpl_forum_vars.NoticeList) != 0 { for _, item := range tmpl_forum_vars.NoticeList { w.Write([]byte(`
` + item + `
`)) } } w.Write([]byte(`
`)) if len(tmpl_forum_vars.ItemList) != 0 { for _, item := range tmpl_forum_vars.ItemList { w.Write([]byte(`
` + item.(TopicUser).Title + ` `)) if item.(TopicUser).Is_Closed { w.Write([]byte(`closed `)) } else { w.Write([]byte(`open`)) } w.Write([]byte(` Status
`)) } } w.Write([]byte(`
`)) if tmpl_forum_vars.Something.(string) != "" { w.Write([]byte(`
` + tmpl_forum_vars.Something.(string) + `
`)) } w.Write([]byte(`
`)) }