mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
UI: long organization name in create repository owner list
This commit is contained in:
parent
4325b01a58
commit
f04d773f4f
6 changed files with 2981 additions and 10 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue