Skip to content

Commit 3f081d4

Browse files
authored
Rename Action.GetDisplayName to GetActDisplayName (#29540)
To avoid conflicting with User.GetDisplayName, because there is no data type in template. And it matches other methods like GetActFullName / GetActUserName
1 parent 27deea7 commit 3f081d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

models/activities/action.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ func (a *Action) ShortActUserName(ctx context.Context) string {
225225
return base.EllipsisString(a.GetActUserName(ctx), 20)
226226
}
227227

228-
// GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
229-
func (a *Action) GetDisplayName(ctx context.Context) string {
228+
// GetActDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
229+
func (a *Action) GetActDisplayName(ctx context.Context) string {
230230
if setting.UI.DefaultShowFullName {
231231
trimmedFullName := strings.TrimSpace(a.GetActFullName(ctx))
232232
if len(trimmedFullName) > 0 {
@@ -236,8 +236,8 @@ func (a *Action) GetDisplayName(ctx context.Context) string {
236236
return a.ShortActUserName(ctx)
237237
}
238238

239-
// GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
240-
func (a *Action) GetDisplayNameTitle(ctx context.Context) string {
239+
// GetActDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
240+
func (a *Action) GetActDisplayNameTitle(ctx context.Context) string {
241241
if setting.UI.DefaultShowFullName {
242242
return a.ShortActUserName(ctx)
243243
}

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="flex-item-main gt-gap-3">
88
<div>
99
{{if gt .ActUser.ID 0}}
10-
<a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetDisplayNameTitle ctx}}">{{.GetDisplayName ctx}}</a>
10+
<a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetActDisplayNameTitle ctx}}">{{.GetActDisplayName ctx}}</a>
1111
{{else}}
1212
{{.ShortActUserName ctx}}
1313
{{end}}

0 commit comments

Comments
 (0)