Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken following organization #29005

Merged
merged 9 commits into from
Feb 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix Description
yp05327 committed Feb 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1a17ca723a750a6973539188410a26444e7ba82c
14 changes: 2 additions & 12 deletions routers/web/org/home.go
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@
"code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/web/shared/user"

Check failure on line 23 in routers/web/org/home.go

GitHub Actions / lint-backend

ST1019: package "code.gitea.io/gitea/routers/web/shared/user" is being imported more than once (stylecheck)

Check failure on line 23 in routers/web/org/home.go

GitHub Actions / lint-go-gogit

ST1019: package "code.gitea.io/gitea/routers/web/shared/user" is being imported more than once (stylecheck)

Check failure on line 23 in routers/web/org/home.go

GitHub Actions / lint-go-windows

ST1019: package "code.gitea.io/gitea/routers/web/shared/user" is being imported more than once (stylecheck)
shared_user "code.gitea.io/gitea/routers/web/shared/user"

Check failure on line 24 in routers/web/org/home.go

GitHub Actions / lint-backend

duplicated-imports: Package "code.gitea.io/gitea/routers/web/shared/user" already imported (revive)

Check failure on line 24 in routers/web/org/home.go

GitHub Actions / lint-go-gogit

duplicated-imports: Package "code.gitea.io/gitea/routers/web/shared/user" already imported (revive)

Check failure on line 24 in routers/web/org/home.go

GitHub Actions / lint-go-windows

duplicated-imports: Package "code.gitea.io/gitea/routers/web/shared/user" already imported (revive)
)

const (
@@ -41,22 +42,11 @@
if ctx.Written() {
return
}

user.PrepareContextForOrgProfileBigAvatar(ctx)
org := ctx.Org.Organization

ctx.Data["PageIsUserProfile"] = true
ctx.Data["Title"] = org.DisplayName()
if len(org.Description) != 0 {
desc, err := markdown.RenderString(&markup.RenderContext{
Ctx: ctx,
Metas: map[string]string{"mode": "document"},
}, org.Description)
if err != nil {
ctx.ServerError("RenderString", err)
return
}
ctx.Data["RenderedDescription"] = desc
}

var orderBy db.SearchOrderBy
ctx.Data["SortType"] = ctx.FormString("sort")
12 changes: 12 additions & 0 deletions routers/web/shared/user/header.go
Original file line number Diff line number Diff line change
@@ -35,6 +35,18 @@ func PrepareContextForOrgProfileBigAvatar(ctx *context.Context) {
prepareContextForCommonProfile(ctx)

ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID)

if len(ctx.ContextUser.Description) != 0 {
desc, err := markdown.RenderString(&markup.RenderContext{
Ctx: ctx,
Metas: map[string]string{"mode": "document"},
}, ctx.ContextUser.Description)
if err != nil {
ctx.ServerError("RenderString", err)
return
}
ctx.Data["RenderedDescription"] = desc
}
}

// PrepareContextForProfileBigAvatar set the context for big avatar view on the profile page