mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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:
committed by
Lunny Xiao
parent
2d1a1fce93
commit
b992858883
@@ -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)
|
||||
|
Reference in New Issue
Block a user