mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Show full name if DefaultShowFullName setting activated (#6710)
Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section. If enabled the full name will be shown (unless it's empty, then the default username will be used)
This commit is contained in:
@ -144,6 +144,22 @@ func (a *Action) ShortActUserName() string {
|
||||
return base.EllipsisString(a.GetActUserName(), 20)
|
||||
}
|
||||
|
||||
// GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME
|
||||
func (a *Action) GetDisplayName() string {
|
||||
if setting.UI.DefaultShowFullName {
|
||||
return a.GetActFullName()
|
||||
}
|
||||
return a.ShortActUserName()
|
||||
}
|
||||
|
||||
// GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
|
||||
func (a *Action) GetDisplayNameTitle() string {
|
||||
if setting.UI.DefaultShowFullName {
|
||||
return a.ShortActUserName()
|
||||
}
|
||||
return a.GetActFullName()
|
||||
}
|
||||
|
||||
// GetActAvatar the action's user's avatar link
|
||||
func (a *Action) GetActAvatar() string {
|
||||
a.loadActUser()
|
||||
|
Reference in New Issue
Block a user