loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

(cherry picked from commit 3f081d4b54261c1b4ee4f1df40c610fdd9581ef2)

authored by

wxiaoguang and committed by
Earl Warren
be9189ed 221a2843

+5 -5
+4 -4
models/activities/action.go
··· 227 227 return base.EllipsisString(a.GetActUserName(ctx), 20) 228 228 } 229 229 230 - // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank. 231 - func (a *Action) GetDisplayName(ctx context.Context) string { 230 + // GetActDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank. 231 + func (a *Action) GetActDisplayName(ctx context.Context) string { 232 232 if setting.UI.DefaultShowFullName { 233 233 trimmedFullName := strings.TrimSpace(a.GetActFullName(ctx)) 234 234 if len(trimmedFullName) > 0 { ··· 238 238 return a.ShortActUserName(ctx) 239 239 } 240 240 241 - // GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME 242 - func (a *Action) GetDisplayNameTitle(ctx context.Context) string { 241 + // GetActDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME 242 + func (a *Action) GetActDisplayNameTitle(ctx context.Context) string { 243 243 if setting.UI.DefaultShowFullName { 244 244 return a.ShortActUserName(ctx) 245 245 }
+1 -1
templates/user/dashboard/feeds.tmpl
··· 7 7 <div class="flex-item-main gt-gap-3"> 8 8 <div> 9 9 {{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> 11 11 {{else}} 12 12 {{.ShortActUserName ctx}} 13 13 {{end}}