mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +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:
parent
a84f10ad1a
commit
4508380cf7
16 changed files with 84 additions and 49 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue