summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-13 23:21:43 +0800
committerUnknwon <u@gogs.io>2015-08-13 23:21:43 +0800
commit1fb53067f478414302096d5d976a3db85df9e2eb (patch)
treeb1b8ba83989fe5edd346a26c6bd0068abbb4d533 /models
parent0ec7d1539b177dbe55f3c68691b0c9f8e35193a9 (diff)
downloadgitea-1fb53067f478414302096d5d976a3db85df9e2eb.tar.gz
gitea-1fb53067f478414302096d5d976a3db85df9e2eb.zip
finish close/reopen issue
Diffstat (limited to 'models')
-rw-r--r--models/action.go2
-rw-r--r--models/issue.go21
2 files changed, 15 insertions, 8 deletions
diff --git a/models/action.go b/models/action.go
index a053a18976..de7f93a973 100644
--- a/models/action.go
+++ b/models/action.go
@@ -153,7 +153,7 @@ func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string
url := fmt.Sprintf("%s/%s/%s/commit/%s", setting.AppSubUrl, repoUserName, repoName, c.Sha1)
message := fmt.Sprintf(`<a href="%s">%s</a>`, url, c.Message)
- if _, err = CreateComment(u, repo, issue, 0, 0, COMMENT_TYPE_COMMIT, message, nil); err != nil {
+ if _, err = CreateComment(u, repo, issue, 0, 0, COMMENT_TYPE_COMMIT_REF, message, nil); err != nil {
return err
}
}
diff --git a/models/issue.go b/models/issue.go
index f32f054584..174e3102d9 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -798,7 +798,7 @@ func GetLabelsByIssueID(issueID int64) ([]*Label, error) {
}
func updateLabel(e Engine, l *Label) error {
- _, err := x.Id(l.ID).AllCols().Update(l)
+ _, err := e.Id(l.ID).AllCols().Update(l)
return err
}
@@ -1222,11 +1222,13 @@ const (
COMMENT_TYPE_CLOSE
// References.
- COMMENT_TYPE_ISSUE
- // Reference from some commit (not part of a pull request)
- COMMENT_TYPE_COMMIT
- // Reference from some pull request
- COMMENT_TYPE_PULL
+ COMMENT_TYPE_ISSUE_REF
+ // Reference from a commit (not part of a pull request)
+ COMMENT_TYPE_COMMIT_REF
+ // Reference from a comment
+ COMMENT_TYPE_COMMENT_REF
+ // Reference from a pull request
+ COMMENT_TYPE_PULL_REF
)
// Comment represents a comment in commit and issue page.
@@ -1245,11 +1247,16 @@ type Comment struct {
Attachments []*Attachment `xorm:"-"`
}
-// HashTag returns unique hash tag for issue.
+// HashTag returns unique hash tag for comment.
func (c *Comment) HashTag() string {
return "issuecomment-" + com.ToStr(c.ID)
}
+// EventTag returns unique event hash tag for comment.
+func (c *Comment) EventTag() string {
+ return "event-" + com.ToStr(c.ID)
+}
+
func (c *Comment) AfterSet(colName string, _ xorm.Cell) {
var err error
switch colName {