summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-26 07:24:20 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-26 07:24:20 -0400
commited9b7d2db9d797105a62a0c2078c614ab90ff956 (patch)
tree6e87b93b78c34d67a3c67e53221a72321670e6df /modules
parent78979c6d4c1408910cf12546b26d727752c62250 (diff)
downloadgitea-ed9b7d2db9d797105a62a0c2078c614ab90ff956.tar.gz
gitea-ed9b7d2db9d797105a62a0c2078c614ab90ff956.zip
More on diff page
Diffstat (limited to 'modules')
-rw-r--r--modules/base/template.go1
-rw-r--r--modules/base/tool.go13
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index 8d95dbeab7..e577bd7c35 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 8f38d492a5..15d42fa751 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"
+ }
+}