UI: long organization name in create repository owner list

This commit is contained in:
Unknwon 2015-11-18 17:42:20 -05:00
parent 4325b01a58
commit f04d773f4f
6 changed files with 2981 additions and 10 deletions

View file

@ -373,6 +373,15 @@ func (u *User) DisplayName() string {
return u.Name
}
// ShortName returns shorted user name with given maximum length,
// it adds "..." at the end if user name has more length than maximum.
func (u *User) ShortName(length int) string {
if len(u.Name) < length {
return u.Name
}
return u.Name[:length] + "..."
}
// IsUserExist checks if given user name exist,
// the user name should be noncased unique.
// If uid is presented, then check will rule out that one,