aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-02-18 21:55:57 -0500
committer无闻 <u@gogs.io>2015-02-18 21:55:57 -0500
commit77ac1e6ff64a3be94f79190635450f8ba4a41dd2 (patch)
treeb2313924f5d9ec4a62b44c70d78bf0923f96d6bd /modules
parentbe19fe48d70cd7ce3ec0d49e2b6f47f83f33ad2f (diff)
parentc0ad512398e0d8232f5e729f2c38e887e6d9329a (diff)
Merge pull request #970 from makhov/the-new-new-highlighting
The new new highlighting
Diffstat (limited to 'modules')
-rw-r--r--modules/base/template.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index 0fd519e6..cfcabb71 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -41,6 +41,10 @@ func List(l *list.List) chan interface{} {
return c
}
+func Sha1(str string) string {
+ return EncodeSha1(str)
+}
+
func ShortSha(sha1 string) string {
if len(sha1) == 40 {
return sha1[:10]
@@ -160,6 +164,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
},
"DiffTypeToStr": DiffTypeToStr,
"DiffLineTypeToStr": DiffLineTypeToStr,
+ "Sha1": Sha1,
"ShortSha": ShortSha,
"Md5": EncodeMd5,
"ActionContent2Commits": ActionContent2Commits,