feat(lored,user): "popular" repositories on user profile

This commit is contained in:
Guz
2025-10-06 13:41:13 -03:00
parent 132aafae75
commit ea20ef698d

View File

@@ -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)