diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index 3a8812a1e1..01486d3825 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -254,6 +254,24 @@ func prepareUserProfileTabData(ctx *context.Context, profileDbRepo *repo_model.R return } + // INFO(contact@guz.one): Popular repositories + if count == 0 { + repos, count, err = repo_model.SearchRepository(ctx, repo_model.SearchRepoOptions{ + ListOptions: db.ListOptions{ + PageSize: 6, + Page: 0, + }, + Actor: ctx.Doer, + OwnerID: ctx.ContextUser.ID, + OrderBy: db.SearchOrderBy(fmt.Sprintf("%s, %s", db.SearchOrderByStarsReverse, db.SearchOrderByRecentUpdated)), + Private: ctx.IsSigned, + }) + if err != nil { + ctx.ServerError("SearchRepository", err) + return + } + } + // prepare heatmap data if setting.Service.EnableUserHeatmap { data, err := activities_model.GetUserHeatmapDataByUser(ctx, ctx.ContextUser, ctx.Doer)