| @@ -6,6 +6,7 @@ | |||||
| package user | package user | ||||
| import ( | import ( | ||||
| "errors" | |||||
| "fmt" | "fmt" | ||||
| "path" | "path" | ||||
| "strings" | "strings" | ||||
| @@ -107,6 +108,9 @@ func Profile(ctx *context.Context) { | |||||
| ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User) | ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User) | ||||
| tab := ctx.Query("tab") | tab := ctx.Query("tab") | ||||
| if tab == "" { | |||||
| tab = "activity" | |||||
| } | |||||
| ctx.Data["TabName"] = tab | ctx.Data["TabName"] = tab | ||||
| page := ctx.QueryInt("page") | page := ctx.QueryInt("page") | ||||
| @@ -230,7 +234,7 @@ func Profile(ctx *context.Context) { | |||||
| } | } | ||||
| total = int(count) | total = int(count) | ||||
| ctx.Data["Datasets"] = datasets | ctx.Data["Datasets"] = datasets | ||||
| default: | |||||
| case "repository": | |||||
| repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ | repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| PageSize: setting.UI.User.RepoPagingNum, | PageSize: setting.UI.User.RepoPagingNum, | ||||
| @@ -251,6 +255,9 @@ func Profile(ctx *context.Context) { | |||||
| } | } | ||||
| total = int(count) | total = int(count) | ||||
| default: | |||||
| ctx.ServerError("tab error", errors.New("tab error")) | |||||
| return | |||||
| } | } | ||||
| ctx.Data["Repos"] = repos | ctx.Data["Repos"] = repos | ||||
| ctx.Data["Total"] = total | ctx.Data["Total"] = total | ||||