|
|
@ -161,14 +161,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.Repo.RepoLink + "/projects") |
|
|
|
ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects") |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
id := ctx.ParamsInt64(":id") |
|
|
|
id := ctx.ParamsInt64(":id") |
|
|
|
|
|
|
|
|
|
|
@ -180,7 +181,7 @@ func ChangeProjectStatus(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) |
|
|
|
ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DeleteProject delete a project
|
|
|
|
// DeleteProject delete a project
|
|
|
|