diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 23f8ea107..116c199b7 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -67,20 +67,3 @@ func Delete(ctx *middleware.Context, form auth.DeleteRepoForm) { ctx.Render.Redirect("/", 302) } - -func List(ctx *middleware.Context) { - if ctx.User != nil { - ctx.Render.Redirect("/") - return - } - - ctx.Data["Title"] = "Repositories" - repos, err := models.GetRepositories(ctx.User) - if err != nil { - ctx.Handle(200, "repo.List", err) - return - } - - ctx.Data["Repos"] = repos - ctx.Render.HTML(200, "repo/list", ctx.Data) -} diff --git a/routers/repo/single.go b/routers/repo/single.go index bd5cfa119..a7f07898f 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -43,7 +43,6 @@ func Single(ctx *middleware.Context, params martini.Params) { ctx.Data["Treenames"] = treenames ctx.Data["IsRepoToolbarSource"] = true ctx.Data["Files"] = files - ctx.Render.HTML(200, "repo/single", ctx.Data) } diff --git a/routers/user/user.go b/routers/user/user.go index 4ba7da161..8d8691a39 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -60,7 +60,12 @@ func Profile(ctx *middleware.Context, params martini.Params) { } ctx.Data["Feeds"] = feeds default: - + repos, err := models.GetRepositories(user) + if err != nil { + ctx.Handle(200, "user.Profile", err) + return + } + ctx.Data["Repos"] = repos } ctx.Render.HTML(200, "user/profile", ctx.Data) diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index 306c3bc15..547e8ab55 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -4,9 +4,9 @@

News Feed

@@ -29,7 +29,7 @@
Your Repositories - New Repo + New Repo
    {{range .MyRepos}} diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 944445201..aa15cb88b 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -44,7 +44,13 @@
{{else}} -
repo
+ {{$owner := .Owner}} +
+ {{range .Repos}} +

{{.LowerName}} Star:{{.NumStars}} Fork:{{.NumForks}}

+

{{.Description}}

+ {{end}} +
{{end}}
diff --git a/web.go b/web.go index af430917f..3f0e0ef7e 100644 --- a/web.go +++ b/web.go @@ -66,7 +66,6 @@ func runWeb(*cli.Context) { m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create) m.Any("/repo/delete", middleware.SignInRequire(true), binding.Bind(auth.DeleteRepoForm{}), repo.Delete) - m.Any("/repo/list", middleware.SignInRequire(false), repo.List) m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting) m.Get("/:username/:reponame/tree/:branchname/**",