Fix added issue comment layout.

This commit is contained in:
shimamoto
2013-06-24 21:29:20 +09:00
parent 9baa09d68b
commit 4000469152
3 changed files with 26 additions and 12 deletions

View File

@@ -69,10 +69,15 @@ trait IssuesControllerBase extends ControllerBase {
val issueId = params("issueId").toInt
val content = params("content") // TODO input check
saveComment(owner, repository, context.loginAccount.get.userName, issueId, content)
contentType = formats("json")
org.json4s.jackson.Serialization.write(Map("content" -> content))
saveComment(owner, repository, context.loginAccount.get.userName, issueId, content) map {
model => org.json4s.jackson.Serialization.write(
Map("commentedUserName" -> model.commentedUserName,
"registeredDate" -> view.helpers.datetime(model.registeredDate),
"content" -> view.Markdown.toHtml(
model.content, getRepository(owner, repository, baseUrl).get, false, true, true)
))
} getOrElse ""
})
}