diff options
author | slene <vslene@gmail.com> | 2014-03-20 09:17:24 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-20 09:17:24 +0800 |
commit | 8b0f421eb504075b7500575515282cd7da8b0878 (patch) | |
tree | e10c71d7fff99207540bac25437165e0aa4da7ac /modules/base/template.go | |
parent | 0e7a2d9d3c59a67e9681d8e6e0d813c191777e2c (diff) | |
parent | 6f6862086047ba6902f51de3cb66eb3af04fffbd (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/base/template.go')
-rw-r--r-- | modules/base/template.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go index 23d3d277..e596d1da 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -8,6 +8,7 @@ import ( "container/list" "fmt" "html/template" + "strings" "time" ) @@ -54,4 +55,10 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "ActionDesc": ActionDesc, "DateFormat": DateFormat, "List": List, + "Mail2Domain": func(mail string) string { + return "mail." + strings.Split(mail, "@")[1] + }, + "SubStr": func(str string, start, length int) string { + return str[start : start+length] + }, } |