diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-17 13:12:57 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-17 13:12:57 +0800 |
commit | d64a8e8d3aa5f1dc606860c0950a8b7dbebf944c (patch) | |
tree | 46d4193e2706989e4bd74c7d2bcae5d365655098 /modules | |
parent | c101471bdfd0a802e66adfb7402dbd980812da30 (diff) | |
parent | 0f68930892bc49966769f8931e9a531b37dacb3b (diff) | |
download | gitea-d64a8e8d3aa5f1dc606860c0950a8b7dbebf944c.tar.gz gitea-d64a8e8d3aa5f1dc606860c0950a8b7dbebf944c.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'modules')
-rw-r--r-- | modules/base/template.go | 1 | ||||
-rw-r--r-- | modules/base/tool.go | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go index b38ab140c9..1a0b5977e3 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -19,6 +19,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "AppVer": func() string { return AppVer }, + "AvatarLink": AvatarLink, "str2html": Str2html, "TimeSince": TimeSince, "FileSize": FileSize, diff --git a/modules/base/tool.go b/modules/base/tool.go index 10b3fee375..046b2c5174 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -22,6 +22,11 @@ func EncodeMd5(str string) string { return hex.EncodeToString(m.Sum(nil)) } +// AvatarLink returns avatar link by given e-mail. +func AvatarLink(email string) string { + return "http://1.gravatar.com/avatar/" + EncodeMd5(email) +} + // Seconds-based time units const ( Minute = 60 |