Former-commit-id: ebbe370ebbb3b076d945a7e68d60a7e426460914
This commit is contained in:
Henrique Dias
2016-12-29 22:50:36 +00:00
parent 66241b81c2
commit b6a7d78ce6
8 changed files with 202 additions and 394 deletions

View File

@@ -3,6 +3,7 @@ package page
import (
"bytes"
"encoding/base64"
"encoding/json"
"html/template"
"log"
@@ -90,12 +91,15 @@ func (p Page) PrintAsHTML(w http.ResponseWriter, templates ...string) (int, erro
a, _ := json.Marshal(v)
return template.JS(a)
},
"EncodeBase64": func(s string) string {
return base64.StdEncoding.EncodeToString([]byte(s))
},
}
if p.Minimal {
templates = append(templates, "actions", "minimal")
templates = append(templates, "minimal")
} else {
templates = append(templates, "actions", "base")
templates = append(templates, "base")
}
var tpl *template.Template