From 0bdd400fe788981284cc148c19345032c3ce5f79 Mon Sep 17 00:00:00 2001 From: odiel Date: Fri, 6 Dec 2013 10:36:12 -0500 Subject: [PATCH 1/2] Update utils.go Adding Assets functions for the template, to generate HTML tags for JS and CSS --- utils.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/utils.go b/utils.go index 0e2b8e13..fafe4190 100644 --- a/utils.go +++ b/utils.go @@ -388,3 +388,22 @@ func GetRandomString(n int) string { func UrlFor(endpoint string, values ...string) string { return BeeApp.UrlFor(endpoint, values...) } + + +//This can be changed to a better name +func AssetsJs(src string) template.HTML { + text := string(src) + + text = "" + + return template.HTML(text) +} + +//This can be changed to a better name +func AssetsCss(src string) template.HTML { + text := string(src) + + text = "" + + return template.HTML(text) +} From 1611476288f03eebdfd8fd7ddbdad223823561ce Mon Sep 17 00:00:00 2001 From: odiel Date: Fri, 6 Dec 2013 10:36:56 -0500 Subject: [PATCH 2/2] Update template.go Adding assets_js, assets_css template functions --- template.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template.go b/template.go index 4e75e39f..5c56da74 100644 --- a/template.go +++ b/template.go @@ -34,6 +34,8 @@ func init() { beegoTplFuncMap["htmlquote"] = Htmlquote beegoTplFuncMap["htmlunquote"] = Htmlunquote beegoTplFuncMap["renderform"] = RenderForm + beegoTplFuncMap["assets_js"] = AssetsJs + beegoTplFuncMap["assets_css"] = AssetsCss // go1.2 added template funcs // Comparisons