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:
Henrique Dias
2017-06-27 09:28:29 +01:00
parent e59605700d
commit 6b963a9880
12 changed files with 268 additions and 301 deletions

12
page.go
View File

@@ -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)
}