|
|
@ -7,7 +7,6 @@ import (
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
@ -195,14 +194,15 @@ func NewProjectPost(ctx *context.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
// ChangeProjectStatus updates the status of a project between "open" and "close"
|
|
|
|
// ChangeProjectStatus updates the status of a project between "open" and "close"
|
|
|
|
func ChangeProjectStatus(ctx *context.Context) {
|
|
|
|
func ChangeProjectStatus(ctx *context.Context) {
|
|
|
|
toClose := false
|
|
|
|
var toClose bool
|
|
|
|
switch ctx.Params(":action") {
|
|
|
|
switch ctx.Params(":action") {
|
|
|
|
case "open":
|
|
|
|
case "open":
|
|
|
|
toClose = false
|
|
|
|
toClose = false
|
|
|
|
case "close":
|
|
|
|
case "close":
|
|
|
|
toClose = true
|
|
|
|
toClose = true
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects")
|
|
|
|
ctx.JSONRedirect(ctx.ContextUser.HomeLink() + "/-/projects")
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
id := ctx.ParamsInt64(":id")
|
|
|
|
id := ctx.ParamsInt64(":id")
|
|
|
|
|
|
|
|
|
|
|
@ -210,7 +210,7 @@ func ChangeProjectStatus(ctx *context.Context) {
|
|
|
|
ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err)
|
|
|
|
ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects?state=" + url.QueryEscape(ctx.Params(":action")))
|
|
|
|
ctx.JSONRedirect(fmt.Sprintf("%s/-/projects/%d", ctx.ContextUser.HomeLink(), id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteProject delete a project
|
|
|
|
// DeleteProject delete a project
|
|
|
|