Feature for editing, creating, uploading and deleting files

This commit is contained in:
Richard Mahn
2016-07-15 18:35:42 -06:00
parent 3d93532c87
commit fa1b752be2
19 changed files with 2848 additions and 1057 deletions

View File

@@ -489,6 +489,20 @@ func runWeb(ctx *cli.Context) error {
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
m.Group("", func() {
m.Combo("/edit/*").Get(repo.EditFile).
Post(bindIgnErr(auth.EditRepoFileForm{}), repo.EditFilePost)
m.Combo("/new/*").Get(repo.EditNewFile).
Post(bindIgnErr(auth.EditRepoFileForm{}), repo.EditNewFilePost)
m.Post("/preview/*", bindIgnErr(auth.EditPreviewDiffForm{}), repo.DiffPreviewPost)
m.Combo("/upload/*").Get(repo.UploadFile).
Post(bindIgnErr(auth.UploadRepoFileForm{}), repo.UploadFilePost)
m.Post("/delete/*", bindIgnErr(auth.DeleteRepoFileForm{}), repo.DeleteFilePost)
m.Post("/branches", bindIgnErr(auth.NewBranchForm{}), repo.NewBranchPost)
m.Post("/upload-file", repo.UploadFileToServer)
m.Post("/upload-remove", bindIgnErr(auth.UploadRemoveFileForm{}), repo.UploadRemoveFileFromServer)
}, context.RepoRef(), context.RepoAssignment(), reqRepoWriter)
}, reqSignIn, context.RepoAssignment(), repo.MustBeNotBare)
m.Group("/:username/:reponame", func() {