|
|
@ -527,25 +527,9 @@ func runWeb(ctx *cli.Context) error { |
|
|
|
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.Post("/delete", repo.DeleteRelease) |
|
|
|
m.Post("/delete", repo.DeleteRelease) |
|
|
|
}, reqRepoWriter, context.RepoRef()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m.Group("/releases", func() { |
|
|
|
|
|
|
|
m.Get("/edit/*", repo.EditRelease) |
|
|
|
m.Get("/edit/*", repo.EditRelease) |
|
|
|
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
}, reqRepoWriter, func(ctx *context.Context) { |
|
|
|
}, reqRepoWriter, context.RepoRef()) |
|
|
|
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 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL
|
|
|
|
// FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL
|
|
|
|
// for PR in same repository. After select branch on the page, the URL contains redundant head user name.
|
|
|
|
// for PR in same repository. After select branch on the page, the URL contains redundant head user name.
|
|
|
|