User code clean and ui improve

This commit is contained in:
Unknown 2014-05-05 16:21:43 -04:00
parent c1eb4d894a
commit bbdfe25769
19 changed files with 308 additions and 322 deletions

View file

@ -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 ""
}