Add close and re-open of the issue.

This commit is contained in:
shimamoto
2013-07-01 21:05:52 +09:00
parent 56cec26c5b
commit 87d8a19e37
4 changed files with 31 additions and 4 deletions

View File

@@ -81,9 +81,12 @@ trait IssuesControllerBase extends ControllerBase {
post("/:owner/:repository/issue_comments/new", commentForm)( usersOnly { form =>
val owner = params("owner")
val repository = params("repository")
val action = params.get("action") filter { action =>
updateClosed(owner, repository, form.issueId, if(action == "close") true else false) > 0
}
redirect("/%s/%s/issues/%d#comment-%d".format(owner, repository, form.issueId,
createComment(owner, repository, context.loginAccount.get.userName, form.issueId, form.content)))
createComment(owner, repository, context.loginAccount.get.userName, form.issueId, form.content, action)))
})
// TODO Authenticator, repository checking