summaryrefslogtreecommitdiffstats
path: root/routers/user/profile.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r--routers/user/profile.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index ef6cb9cd9d..1f5acbec0d 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -97,12 +97,27 @@ func Profile(ctx *context.Context) {
return
}
case "stars":
- starredRepos, err := ctxUser.GetStarredRepos(showPrivate)
+ page := ctx.QueryInt("page")
+ if page <= 0 {
+ page = 1
+ }
+
+ repos, err := ctxUser.GetStarredRepos(showPrivate, page, setting.UI.User.RepoPagingNum, "")
if err != nil {
ctx.Handle(500, "GetStarredRepos", err)
return
}
- ctx.Data["Repos"] = starredRepos
+
+ counts, err := ctxUser.GetStarredRepoCount(showPrivate)
+ if err != nil {
+ ctx.Handle(500, "GetStarredRepoCount", err)
+ return
+ }
+
+ ctx.Data["Repos"] = repos
+ ctx.Data["Page"] = paginater.New(int(counts), setting.UI.User.RepoPagingNum, page, 5)
+ ctx.Data["Total"] = int(counts)
+ ctx.Data["Tabs"] = "stars"
default:
page := ctx.QueryInt("page")
if page <= 0 {