diff options
Diffstat (limited to 'modules/templates/dynamic.go')
-rw-r--r-- | modules/templates/dynamic.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/templates/dynamic.go b/modules/templates/dynamic.go index d70a465c1c..dbd75221d2 100644 --- a/modules/templates/dynamic.go +++ b/modules/templates/dynamic.go @@ -45,6 +45,18 @@ func JSONRenderer() macaron.Handler { }) } +// JSRenderer implements the macaron handler for serving JS templates. +func JSRenderer() macaron.Handler { + return macaron.Renderer(macaron.RenderOptions{ + Funcs: NewFuncMap(), + Directory: path.Join(setting.StaticRootPath, "templates"), + AppendDirectories: []string{ + path.Join(setting.CustomPath, "templates"), + }, + HTMLContentType: "application/javascript", + }) +} + // Mailer provides the templates required for sending notification mails. func Mailer() *template.Template { for _, funcs := range NewFuncMap() { |