mirror of
https://github.com/gogs/gogs.git
synced 2026-06-20 21:01:40 +02:00
Feature for editing, creating, uploading and deleting files
This commit is contained in:
14
cmd/web.go
14
cmd/web.go
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user