|
@ -497,11 +497,27 @@ func runWeb(ctx *cli.Context) error { |
|
|
m.Group("/releases", func() { |
|
|
m.Group("/releases", func() { |
|
|
m.Get("/new", repo.NewRelease) |
|
|
m.Get("/new", repo.NewRelease) |
|
|
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) |
|
|
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) |
|
|
m.Get("/edit/*", repo.EditRelease) |
|
|
|
|
|
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
|
|
m.Post("/delete", repo.DeleteRelease) |
|
|
m.Post("/delete", repo.DeleteRelease) |
|
|
}, reqRepoWriter, context.RepoRef()) |
|
|
}, reqRepoWriter, context.RepoRef()) |
|
|
|
|
|
|
|
|
|
|
|
m.Group("/releases", func() { |
|
|
|
|
|
m.Get("/edit/*", repo.EditRelease) |
|
|
|
|
|
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
|
|
}, reqRepoWriter, func(ctx *context.Context) { |
|
|
|
|
|
var err error |
|
|
|
|
|
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
ctx.Handle(500, "GetBranchCommit", err) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
ctx.Repo.CommitsCount, err = ctx.Repo.Commit.CommitsCount() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
ctx.Handle(500, "CommitsCount", err) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest). |
|
|
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest). |
|
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) |
|
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) |
|
|
|
|
|
|
|
|