diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 23f8ea107c..116c199b7d 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 e933951050..d796d9639d 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -41,7 +41,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 4ba7da1615..8d8691a39f 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 306c3bc15d..547e8ab556 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 9444452012..aa15cb88bb 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 ad19a5da01..8d4fd5b5c9 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), auth.RepoAssignment(true), repo.Setting) m.Get("/:username/:reponame/tree/:branchname/**",