finish close/reopen issue
This commit is contained in:
parent
0ec7d1539b
commit
1fb53067f4
12 changed files with 115 additions and 27 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue