diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-26 20:02:15 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-26 20:02:15 +0800 |
commit | 0b22d90b7c936a7be4dd4c8e53b1af190aefe649 (patch) | |
tree | a699dd351bfa011211fe68ce387d6fe4ccf27044 /modules | |
parent | f5c9149dd52c0cf058a730fd9c912880638b02d8 (diff) | |
parent | 409e4cde7a379bbdbe53367b3726f64b80aed0eb (diff) |
Merge branch 'master' of https://github.com/gogits/gogs
Diffstat (limited to 'modules')
-rw-r--r-- | modules/base/template.go | 1 | ||||
-rw-r--r-- | modules/base/tool.go | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go index 8d95dbea..e577bd7c 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -70,4 +70,5 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "SubStr": func(str string, start, length int) string { return str[start : start+length] }, + "DiffTypeToStr": DiffTypeToStr, } diff --git a/modules/base/tool.go b/modules/base/tool.go index 8f38d492..15d42fa7 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -539,3 +539,16 @@ func ActionDesc(act Actioner, avatarLink string) string { return "invalid type" } } + +func DiffTypeToStr(diffType int) string { + switch diffType { + case 1: + return "add" + case 2: + return "modify" + case 3: + return "del" + default: + return "unknown" + } +} |