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.

Fix missing code in the user profile (#29865)

fix #29820
deleted by
https://github.com/go-gitea/gitea/pull/29248/files#diff-2b0b591787f16325539485e648a09ab6d3177f47dc129cfe84a35ffe141dfd19L39-L62,
which causing malfunction of follow/unfollow and missing description in
the user profile page.

(cherry picked from commit 5ca65d33906ebbca1e502536ffef18942b541c1d)

Conflicts:
routers/web/shared/user/header.go
trivial context conflict because of user blocking code

authored by

Nanguan Lin and committed by
Earl Warren
a2f4ab60 20f839ad

+14
+14
routers/web/shared/user/header.go
··· 16 16 "code.gitea.io/gitea/modules/git" 17 17 "code.gitea.io/gitea/modules/gitrepo" 18 18 "code.gitea.io/gitea/modules/log" 19 + "code.gitea.io/gitea/modules/markup" 20 + "code.gitea.io/gitea/modules/markup/markdown" 19 21 "code.gitea.io/gitea/modules/optional" 20 22 "code.gitea.io/gitea/modules/setting" 21 23 "code.gitea.io/gitea/services/context" ··· 35 37 prepareContextForCommonProfile(ctx) 36 38 37 39 ctx.Data["IsBlocked"] = ctx.Doer != nil && user_model.IsBlocked(ctx, ctx.Doer.ID, ctx.ContextUser.ID) 40 + ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID) 38 41 ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate 39 42 if setting.Service.UserLocationMapURL != "" { 40 43 ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location) ··· 46 49 return 47 50 } 48 51 ctx.Data["OpenIDs"] = openIDs 52 + if len(ctx.ContextUser.Description) != 0 { 53 + content, err := markdown.RenderString(&markup.RenderContext{ 54 + Metas: map[string]string{"mode": "document"}, 55 + Ctx: ctx, 56 + }, ctx.ContextUser.Description) 57 + if err != nil { 58 + ctx.ServerError("RenderString", err) 59 + return 60 + } 61 + ctx.Data["RenderedDescription"] = content 62 + } 49 63 50 64 showPrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID) 51 65 orgs, err := db.Find[organization.Organization](ctx, organization.FindOrgOptions{