summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2016-12-29 12:58:24 -0200
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-29 22:58:24 +0800
commitb9928588834a9aad1771ba79f1d6638cdc29904a (patch)
tree790d6d87a1565076a1fd06d28618d465366b9350 /routers
parent2d1a1fce934cb87cc67b85083d342b14bb52b780 (diff)
downloadgitea-b9928588834a9aad1771ba79f1d6638cdc29904a.tar.gz
gitea-b9928588834a9aad1771ba79f1d6638cdc29904a.zip
Tab on user profile to show starred repos (#519)
* Tab on user profile to show starred repos * Make golint happy and use transactions on StarRepo function * x -> sess * Use sess.Close() instead of sess.Rollback() * Add copyright * Fix lint
Diffstat (limited to 'routers')
-rw-r--r--routers/user/profile.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index a5f4a97efd..f72ced7b3c 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -95,6 +95,14 @@ func Profile(ctx *context.Context) {
if ctx.Written() {
return
}
+ case "stars":
+ showPrivateRepos := ctx.IsSigned && ctx.User.ID == ctxUser.ID
+ starredRepos, err := ctxUser.GetStarredRepos(showPrivateRepos)
+ if err != nil {
+ ctx.Handle(500, "GetStarredRepos", err)
+ return
+ }
+ ctx.Data["Repos"] = starredRepos
default:
page := ctx.QueryInt("page")
if page <= 0 {
@@ -138,11 +146,6 @@ func Following(ctx *context.Context) {
repo.RenderUserCards(ctx, u.NumFollowing, u.GetFollowing, tplFollowers)
}
-// Stars show repositories user starred
-func Stars(ctx *context.Context) {
-
-}
-
// Action response for follow/unfollow user request
func Action(ctx *context.Context) {
u := GetUserByParams(ctx)