summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/helper.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index bdcaa12754..2d7a1aee9b 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -246,6 +246,18 @@ func NewFuncMap() []template.FuncMap {
"MirrorFullAddress": mirror_service.AddressNoCredentials,
"MirrorUserName": mirror_service.Username,
"MirrorPassword": mirror_service.Password,
+ "CommitType": func(commit interface{}) string {
+ switch commit.(type) {
+ case models.SignCommitWithStatuses:
+ return "SignCommitWithStatuses"
+ case models.SignCommit:
+ return "SignCommit"
+ case models.UserCommit:
+ return "UserCommit"
+ default:
+ return ""
+ }
+ },
}}
}