Remove third party rice boxes
Former-commit-id: b52f339d7a13e12d6e7d194a4e5ce4dabae7b61c [formerly 8ee8ebe7d1133b8ca7c46854a31a0a711b5579fc] [formerly 05100c5f169e072f21204537f4d8ddaf2f821377 [formerly 3c821a541373fc8e6b0323bb6abe5a0447931694]] Former-commit-id: e5d5c4ac1d7518d8032ace12bf5efe26d0502a6b [formerly ea15d87d509cc85d2865d9a249acd15975dfa43d] Former-commit-id: 08848510019b280a91a61156e88f5b914d4f8d88
This commit is contained in:
12
page.go
12
page.go
@@ -117,7 +117,7 @@ func (p page) PrintAsHTML(w http.ResponseWriter, m *FileManager, templates ...st
|
||||
// For each template, add it to the the tpl variable
|
||||
for i, t := range templates {
|
||||
// Get the template from the assets
|
||||
Page, err := getTemplate(m, t+".tmpl")
|
||||
Page, err := m.assets.templates.String(t + ".tmpl")
|
||||
|
||||
// Check if there is some error. If so, the template doesn't exist
|
||||
if err != nil {
|
||||
@@ -165,13 +165,3 @@ func (p page) PrintAsJSON(w http.ResponseWriter) (int, error) {
|
||||
|
||||
return http.StatusOK, nil
|
||||
}
|
||||
|
||||
func getTemplate(m *FileManager, template string) (string, error) {
|
||||
if m.Assets.Templates != nil {
|
||||
if tpl, err := m.Assets.Templates.String(template); err == nil {
|
||||
return tpl, err
|
||||
}
|
||||
}
|
||||
|
||||
return m.Assets.baseTemplates.String(template)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user