diff options
author | Romain <romdum@users.noreply.github.com> | 2021-02-11 17:32:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 17:32:27 +0100 |
commit | c69c01d2b6b08a89448b5596fd2233fa4e802ac3 (patch) | |
tree | 16d461903abbd5bd29ae4905b8506a752d632619 /routers/repo/projects.go | |
parent | ac97ea573c1b10d03e72775e8f74b9fe5453bfc8 (diff) | |
download | gitea-c69c01d2b6b08a89448b5596fd2233fa4e802ac3.tar.gz gitea-c69c01d2b6b08a89448b5596fd2233fa4e802ac3.zip |
Sort / Move project boards (#14634)
Sort Project board (#14533)
Diffstat (limited to 'routers/repo/projects.go')
-rw-r--r-- | routers/repo/projects.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/routers/repo/projects.go b/routers/repo/projects.go index 49bcfef0ce..4aa03e9efc 100644 --- a/routers/repo/projects.go +++ b/routers/repo/projects.go @@ -403,7 +403,7 @@ func DeleteProjectBoard(ctx *context.Context) { // AddBoardToProjectPost allows a new board to be added to a project. func AddBoardToProjectPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.EditProjectBoardTitleForm) + form := web.GetForm(ctx).(*auth.EditProjectBoardForm) if !ctx.Repo.IsOwner() && !ctx.Repo.IsAdmin() && !ctx.Repo.CanAccess(models.AccessModeWrite, models.UnitTypeProjects) { ctx.JSON(403, map[string]string{ "message": "Only authorized users are allowed to perform this action.", @@ -481,9 +481,9 @@ func checkProjectBoardChangePermissions(ctx *context.Context) (*models.Project, return project, board } -// EditProjectBoardTitle allows a project board's title to be updated -func EditProjectBoardTitle(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.EditProjectBoardTitleForm) +// EditProjectBoard allows a project board's to be updated +func EditProjectBoard(ctx *context.Context) { + form := web.GetForm(ctx).(*auth.EditProjectBoardForm) _, board := checkProjectBoardChangePermissions(ctx) if ctx.Written() { return @@ -493,6 +493,10 @@ func EditProjectBoardTitle(ctx *context.Context) { board.Title = form.Title } + if form.Sorting != 0 { + board.Sorting = form.Sorting + } + if err := models.UpdateProjectBoard(board); err != nil { ctx.ServerError("UpdateProjectBoard", err) return |