diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 644403452..5769aff7c 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -6,8 +6,6 @@ package repo import ( "net/http" - - "github.com/codegangsta/martini" "github.com/martini-contrib/render" "github.com/martini-contrib/sessions" @@ -87,20 +85,6 @@ func Delete(req *http.Request, r render.Render, data base.TmplData, session sess } } -func Repo(params martini.Params, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { - data["Title"] = "Repository" - files, err := models.GetReposFiles(params["username"], params["reponame"], "HEAD", "/") - if err != nil { - data["ErrorMsg"] = err - log.Error("repo.List: %v", err) - r.HTML(200, "base/error", data) - return - } - - data["Files"] = files - r.HTML(200, "repo/repo", data) -} - func List(req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { u := auth.SignedInUser(session) if u != nil { diff --git a/routers/repo/single.go b/routers/repo/single.go index be27db8e0..811aed399 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -1,16 +1,17 @@ package repo import ( + "net/http" + "github.com/codegangsta/martini" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/martini-contrib/render" "github.com/martini-contrib/sessions" - "net/http" + "github.com/qiniu/log" ) - func Single(params martini.Params, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { var ( user *models.User @@ -52,5 +53,14 @@ func Single(params martini.Params, req *http.Request, r render.Render, data base data["RepositoryLink"] = data["Title"] data["IsRepoToolbarSource"] = true + files, err := models.GetReposFiles(params["username"], params["reponame"], "HEAD", "/") + if err != nil { + data["ErrorMsg"] = err + log.Error("repo.List: %v", err) + r.HTML(200, "base/error", data) + return + } + + data["Files"] = files r.HTML(200, "repo/single", data) } diff --git a/templates/repo/repo.tmpl b/templates/repo/repo.tmpl deleted file mode 100644 index 5ae3f25c1..000000000 --- a/templates/repo/repo.tmpl +++ /dev/null @@ -1,10 +0,0 @@ -{{template "base/head" .}} -{{template "base/navbar" .}} -