diff options
author | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-24 10:15:05 +0200 |
---|---|---|
committer | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-24 10:15:05 +0200 |
commit | d43c5895bc5026fb29dd9aa509056e49b4644ba7 (patch) | |
tree | 52e07c859411253fd87f29a3e6798e3f082b0459 /routers | |
parent | c850c01007f9853bb22c940f47d3d7f1d00ba1cb (diff) | |
download | gitea-d43c5895bc5026fb29dd9aa509056e49b4644ba7.tar.gz gitea-d43c5895bc5026fb29dd9aa509056e49b4644ba7.zip |
Update template and style, only close commit if commit is in same repository
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index dbeb886bc5..2d1c23d4b9 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -393,7 +393,10 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) { return } comments[i].Poster = u - comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink)) + + if comments[i].Type == models.COMMENT { + comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink)) + } } ctx.Data["Title"] = issue.Name @@ -649,9 +652,9 @@ func Comment(ctx *middleware.Context, params martini.Params) { } } - cmtType := models.IT_CLOSE + cmtType := models.CLOSE if !issue.IsClosed { - cmtType = models.IT_REOPEN + cmtType = models.REOPEN } if err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, cmtType, ""); err != nil { @@ -667,7 +670,7 @@ func Comment(ctx *middleware.Context, params martini.Params) { if len(content) > 0 { switch params["action"] { case "new": - if err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, models.IT_PLAIN, content); err != nil { + if err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, models.COMMENT, content); err != nil { ctx.Handle(500, "issue.Comment(create comment)", err) return } |