summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAlexey Makhov <makhov.alex@gmail.com>2015-02-19 00:52:22 +0300
committerAlexey Makhov <makhov.alex@gmail.com>2015-02-19 00:52:22 +0300
commit563e8b4ea98e57adf3992dcaef76b86d29c13cec (patch)
treec77d91a4b1cf6265d0bfce9490b23dfbae95ec40 /modules
parentbe19fe48d70cd7ce3ec0d49e2b6f47f83f33ad2f (diff)
downloadgitea-563e8b4ea98e57adf3992dcaef76b86d29c13cec.tar.gz
gitea-563e8b4ea98e57adf3992dcaef76b86d29c13cec.zip
gitlab-like hash naming
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 0fd519e6c5..cfcabb71a2 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,