// Package admin desrcibes the admin view containing references to // various managers and editors package admin import ( "bytes" "html/template" "github.com/nilslice/cms/content" ) const adminHTML = ` CMS
{{ if .Subview}}
{{ .Subview }}
{{ end }}
` type admin struct { Types map[string]func() interface{} Subview template.HTML } // Admin ... func Admin(view []byte) ([]byte, error) { a := admin{ Types: content.Types, Subview: template.HTML(view), } buf := &bytes.Buffer{} tmpl := template.Must(template.New("admin").Parse(adminHTML)) err := tmpl.Execute(buf, a) if err != nil { return nil, err } return buf.Bytes(), nil }