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
This commit is contained in:
parent
2d1a1fce93
commit
b992858883
7 changed files with 115 additions and 76 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue