forked from forgejo/forgejo
#2287 Truncate repository name if too long
This commit is contained in:
parent
a2ef9a2b64
commit
f43cc90841
12 changed files with 89 additions and 33 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue