diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-06 20:47:21 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-06 20:47:21 -0500 |
commit | 5a99e9a37b1fa194675655e64d5f32ac6cf61729 (patch) | |
tree | 4ee490607e65c5dfca4fa7c7b5b8b59a461a838f /routers | |
parent | afccd0a3eeb070100b375cd9bb83cd5b213d01b3 (diff) | |
download | gitea-5a99e9a37b1fa194675655e64d5f32ac6cf61729.tar.gz gitea-5a99e9a37b1fa194675655e64d5f32ac6cf61729.zip |
models/action.go: add action reopen for #462
- models/issue.go: format comment type names
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 999fd0a892..3e0206dafb 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -424,7 +424,7 @@ func ViewIssue(ctx *middleware.Context) { } comments[i].Poster = u - if comments[i].Type == models.COMMENT { + if comments[i].Type == models.COMMENT_TYPE_COMMENT { comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink)) } } @@ -774,9 +774,9 @@ func Comment(ctx *middleware.Context) { } } - cmtType := models.CLOSE + cmtType := models.COMMENT_TYPE_CLOSE if !issue.IsClosed { - cmtType = models.REOPEN + cmtType = models.COMMENT_TYPE_REOPEN } if _, err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, cmtType, "", nil); err != nil { @@ -795,7 +795,7 @@ func Comment(ctx *middleware.Context) { if len(content) > 0 || len(ctx.Req.MultipartForm.File["attachments"]) > 0 { switch ctx.Params(":action") { case "new": - if comment, err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, models.COMMENT, content, nil); err != nil { + if comment, err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, models.COMMENT_TYPE_COMMENT, content, nil); err != nil { send(500, nil, err) return } @@ -1122,18 +1122,18 @@ func IssueGetAttachment(ctx *middleware.Context) { // testing route handler for new issue ui page // todo : move to Issue() function -func Issues2(ctx *middleware.Context){ - ctx.HTML(200,"repo/issue2/list") +func Issues2(ctx *middleware.Context) { + ctx.HTML(200, "repo/issue2/list") } -func PullRequest2(ctx *middleware.Context){ - ctx.HTML(200,"repo/pr2/list") +func PullRequest2(ctx *middleware.Context) { + ctx.HTML(200, "repo/pr2/list") } -func Labels2(ctx *middleware.Context){ - ctx.HTML(200,"repo/issue2/labels") +func Labels2(ctx *middleware.Context) { + ctx.HTML(200, "repo/issue2/labels") } -func Milestones2(ctx *middleware.Context){ - ctx.HTML(200,"repo/milestone2/list") +func Milestones2(ctx *middleware.Context) { + ctx.HTML(200, "repo/milestone2/list") } |