diff options
author | Unknwon <u@gogs.io> | 2016-01-11 20:41:43 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-01-11 20:41:43 +0800 |
commit | f43cc908411a62c9252eb42484e5096810272369 (patch) | |
tree | 32220fed52d2f9c416dd94d26ebaf267caebca23 /models/user.go | |
parent | a2ef9a2b648422610a7f2cc6211e1f7a9549575f (diff) | |
download | gitea-f43cc908411a62c9252eb42484e5096810272369.tar.gz gitea-f43cc908411a62c9252eb42484e5096810272369.zip |
#2287 Truncate repository name if too long
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/models/user.go b/models/user.go index f648a8abcf..5c43a23a2f 100644 --- a/models/user.go +++ b/models/user.go @@ -429,13 +429,8 @@ 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] + "..." + return base.EllipsisString(u.Name, length) } // IsUserExist checks if given user name exist, |