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

Show the repo count in code tab on both user profile and org page. #27048

Merged
merged 8 commits into from
Sep 13, 2023
16 changes: 10 additions & 6 deletions routers/web/user/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ func CodeSearch(ctx *context.Context) {
shared_user.PrepareContextForProfileBigAvatar(ctx)
shared_user.RenderUserHeader(ctx)

var (
repoIDs []int64
err error
)
err = shared_user.LoadHeaderCount(ctx)
if err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
puni9869 marked this conversation as resolved.
Show resolved Hide resolved

ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["Title"] = ctx.Tr("explore.code")
Expand All @@ -47,11 +57,6 @@ func CodeSearch(ctx *context.Context) {
return
}

var (
repoIDs []int64
err error
)

page := ctx.FormInt("page")
if page <= 0 {
page = 1
Expand Down Expand Up @@ -105,7 +110,6 @@ func CodeSearch(ctx *context.Context) {
}
ctx.Data["SearchResults"] = searchResults
ctx.Data["SearchResultLanguages"] = searchResultLanguages

pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "l", "Language")
Expand Down