summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-01-23 09:54:16 +0200
committerPeter Smit <peter@smitmail.eu>2015-01-23 09:54:16 +0200
commit76f89047183fc70a077ac37b4168d90539f12e09 (patch)
tree4d57f8e0fa667a3a08f1ee55c49b9c0f95085844 /routers/user
parentc6b87aaf02b711d8b1ee7a40f57ba23f560e2a63 (diff)
downloadgitea-76f89047183fc70a077ac37b4168d90539f12e09.tar.gz
gitea-76f89047183fc70a077ac37b4168d90539f12e09.zip
Introducing Collaboration Struct
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 1aabe08774..5b02154c10 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -49,13 +49,19 @@ func Dashboard(ctx *middleware.Context) {
} else {
// Normal user.
ctxUser = ctx.User
- collaborates, err := models.GetCollaborativeRepos(ctxUser.Name)
+ collaborates, err := ctx.User.GetAccessibleRepositories()
if err != nil {
- ctx.Handle(500, "GetCollaborativeRepos", err)
+ ctx.Handle(500, "GetAccessibleRepositories", err)
return
}
- ctx.Data["CollaborateCount"] = len(collaborates)
- ctx.Data["CollaborativeRepos"] = collaborates
+
+ repositories := make([]*models.Repository, 0, len(collaborates))
+ for repo := range collaborates {
+ repositories = append(repositories, repo)
+ }
+
+ ctx.Data["CollaborateCount"] = len(repositories)
+ ctx.Data["CollaborativeRepos"] = repositories
}
ctx.Data["ContextUser"] = ctxUser