aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/template.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-05 16:21:43 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-05 16:21:43 -0400
commitbbdfe2576966210cfffc830bfbe3731bcf653b3b (patch)
treebc0fc83c71887270c4f38d53be8383985ffd01c5 /modules/base/template.go
parentc1eb4d894a092aed1b87ddf5f80ee824fd56789d (diff)
downloadgitea-bbdfe2576966210cfffc830bfbe3731bcf653b3b.tar.gz
gitea-bbdfe2576966210cfffc830bfbe3731bcf653b3b.zip
User code clean and ui improve
Diffstat (limited to 'modules/base/template.go')
-rw-r--r--modules/base/template.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index dd98df75b1..a69a54618d 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -93,6 +93,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
"DiffLineTypeToStr": DiffLineTypeToStr,
"ShortSha": ShortSha,
"Oauth2Icon": Oauth2Icon,
+ "Oauth2Name": Oauth2Name,
}
type Actioner interface {
@@ -217,3 +218,19 @@ func Oauth2Icon(t int) string {
}
return ""
}
+
+func Oauth2Name(t int) string {
+ switch t {
+ case 1:
+ return "GitHub"
+ case 2:
+ return "Google"
+ case 3:
+ return "Twitter"
+ case 4:
+ return "Tencent QQ"
+ case 5:
+ return "Weibo"
+ }
+ return ""
+}