diff options
author | Bwko <bouwko@gmail.com> | 2017-10-26 02:49:16 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-10-26 08:49:16 +0800 |
commit | 3ab580c8d6b8a2c063d848f8e3002347c9e5cebb (patch) | |
tree | 3f66f793be25db1ca8baac8d5333e39bfdd4f7e1 /routers/routes | |
parent | e86a0bf3feab82c1b3439806245083dffb2f37c9 (diff) | |
download | gitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.tar.gz gitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.zip |
Add branch overiew page (#2108)
* Add branch overiew page
* fix changed method name on sub menu
* remove unused code
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 46521130f8..227b4fff9c 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -550,7 +550,10 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/branches", func() { m.Post("/_new/*", context.RepoRef(), bindIgnErr(auth.NewBranchForm{}), repo.CreateBranch) - }, reqRepoWriter, repo.MustBeNotBare) + m.Post("/delete", repo.DeleteBranchPost) + m.Post("/restore", repo.RestoreBranchPost) + }, reqRepoWriter, repo.MustBeNotBare, context.CheckUnit(models.UnitTypeCode)) + }, reqSignIn, context.RepoAssignment(), context.UnitTypes(), context.LoadRepoUnits()) // Releases @@ -615,6 +618,10 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/archive/*", repo.MustBeNotBare, context.CheckUnit(models.UnitTypeCode), repo.Download) + m.Group("/branches", func() { + m.Get("", repo.Branches) + }, repo.MustBeNotBare, context.RepoRef(), context.CheckUnit(models.UnitTypeCode)) + m.Group("/pulls/:index", func() { m.Get("/commits", context.RepoRef(), repo.ViewPullCommits) m.Get("/files", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.ViewPullFiles) |